Public Repository

Last pushed: a year ago
Short Description
Api-spec-converter from stoplight into docker container
Full Description

Raml-to-Swagger

This is a NodeJS Application that converts from Raml to Swagger. Its using the library https://github.com/stoplightio/api-spec-converter in order to do the transformation

It deploys an express server with an endpoint to sent a RAML and obtain the appropiate Swagger.

Set up for NodeJS

In order to test the node application before generating the docker image, its needed to execute the command:

npm install

After that, you just need to execute:

npm start

And server is listening in http://localhost:8080

It has two endpoints:

/raml:
It is just a test endpoint that returns a RAML included.

http://localhost:8080/raml

It can be used on the other endpoint to test.

/swagger
It is the main endpoint, it recieves an url as a query parameter in raml, and generates a body response with the Swagger. For example:

http://localhost:8080/swagger?raml=http://localhost:8080/raml

Set up for Docker

To build this repository into an image:

docker build -t <your-repository>/<your-image> .

Right now is uploaded into thenanox/api-spec-converter to test

To run this repository:

You just need to map the server port 8080

If you build the image in your own repository and image, you run this command:

docker run –p 8080:8080 <your-repository>/<your-image>

You can use the image uploaded into thenanox/api-spec-converter like this:

docker run –p 8080:8080 thenanox/api-spec-converter

In order to test, you may try the application in the browser accessing the endpoint as explained in Set up for NodeJS:

http://<url>:8080/swagger?raml=http://<url>:8080/raml

In windows URL is the IP from the docker-machine. Usually 192.168.99.100.

http://192.168.99.100:8080/swagger?raml=http://192.168.99.100:8080/raml
Docker Pull Command
Owner
thenanox