8x8Cloud / swagger2raml

A utility to generate RAML documentation from Swagger JSON
Other
84 stars 8 forks source link

Generating raml from the file #10

Open emanov opened 10 years ago

emanov commented 10 years ago

We are developing swagger contracts offline, so we don't have URI for the swagger files. And to generate RAML I should install WWW server and deploy swagger contracts to it. It would be good to have ability to generate RAML from the file not from the URI

rucek commented 10 years ago

@emanov what's the structure of the Swagger files you are creating? Is it compliant with the official schema, i.e. you have a resource listing file plus a separate file for each resource? Or are you somehow putting everything into a single file?

The bottomline is that I can implement generating the RAML from Swagger files as long as they are structured as if the were on a server, i.e. a resource listing is present in the root directory and proper subdirectories exist with Swagger files for each resource - as specified by the resource listing.

If you already have a directory structure like this, and if you have Python installed, there is a workaround: you may use python -m SimpleHTTPServer in the root directory to easily serve the local files via HTTP server.

rgoupil commented 7 years ago

Even though this is a very old issue, I would suggest to try giving a "file://" url to the converter (e.g: file:///C:/Users/thatsme/Documents/swagger.json). I haven't tried with a swagger 1.x file so I can't tell if using file:// url can lead to other issues but I know that the converter did find the file and output the correct API title (even though it was a 2.0 swagger API).

I hope this might help someone later.