Code generation from raml 1.0 type defenitions



The new type system built into raml 1.0 for defining complex types is really cool, however it leaves me with a bit of a tooling gap. We’re rather religious about contract first development and previously when using json schema to define types we could leverage tooling like jackson to generate pojos from the json schema. This is great for developer productivity and also ensures much better alignment of the api implementation with the api contract.

Are there any projects currently in development that will provide code generation functionality for the raml 1.0 type system?

If not, is there any advise on starting points for building something like this?



We’re working on RAML 1.0 integration in scraml, which is a client generator for Java and Scala that also generates your DTO’s from your json-schema (and in the future from RAML 1.0 types). We’re hoping to get this integrated by mid 2016.


Any new on this?


We are currently working on raml-for-jaxrs support for RAML 1.0. There is a first release candidate version here. Feedback always welcome.

@Peter_Rigole any updates on scraml?



We decided that it was necessary to rewrite the whole typesystem code in scraml to better support RAML 1.0 types and to support the future addition of new target platforms (such as Java/Android, Swift/iPhone, Python, C#, …). The obvious drawback of this is that we spent a lot of extra time and we are now largely overshooting our target date for RAML 1.0 support. We are currently in a test phase of a version that has basic RAML 1.0 types with type inheritance and experimental multiple inheritance. Especially the multiple inheritance part causes challenging serialization and deserialization code to and from json, but we will get there :slight_smile: Union types are the next hurdle, but we will probably decide to leave union types out of the next version and add it later. Our hopes are on a release in March.