RAML to Swagger


#1

Some of our company system uses Swagger, so wondering about RAML to Swagger tool (like Swagger to RAML). This would help us getting started or to try with RAML.


#2

Did you find a solution for converting RAML to swagger? We are at the same juncture - we already have a services portal with Swagger interface and we are looking to integrate the API designer into it such that the resulting raml file(s) is automatically converted to swagger for the rest of the portal UX to work normally.


#3

I had a requirement to convert RAML into Swagger so I took a peak on it and build a service that converts given RAML into Swagger JSON at runtime. Because all I had was <2 days so its pretty much a flat file structure and in next version I will be modularizing the code more so that its easier to extend as well. Its pretty easy to use and available on the GitHib as open source project so feel free to use it and give me the feedback.

Githib URL is: https://github.com/BulandMalik/RAML2Swagger


#4

Thank you for putting it together, Buland. It is great to bridge our existing Services Portal using swagger with the API Designer.


#5

Be aware of some risks:

  • RAML is more general than Swagger. E.g. RAML allows general support for JSON Schema, Swagger supports only subset. This means, it is easy to design good API in RAML and finding, it will not be fully working in Swagger.
  • Swagger spec is sometime a bit moving target (changing used structure)

My Conclusion:

  • the conversion shall be possible on basic level, what can offer basic service (see all endpoints, some arguments and parameters)
  • it is likely, the conversion will not be complete for many RAML documents as RAML offers more (very practical) constructs than Swagger.

#6

I think Restlet IDE can help a little.
http://studio.restlet.com/


#7

Little, but not much in this context, because it unfortunately doesn’t allow import of RAML.


#8

You can use SoapUI with both plugins for RAML and Swagger. Then import the RAML project and export it into Swagger. It worked for me.


#10

Try this java project… https://github.com/esh-b/RAML-to-Swagger-Converter It converts RAML 0.8 to Swagger 2.0 definition. Also, any contribution is highly welcome.