State of RAML 1.0 to JAX-RS support


#1

Hi,

I was wondering if anyone can confirm the state of play with RAML 1.0 to JAX-RS generation please?

I made a simple 0.8 RAML API with JSON schema objects and using Maven and the raml-jaxrs-maven-plugin (1.3.4) plugin this generated the interfaces and schema as expected. I’ve subsequently migrated this to RAML 1.0 and now use data types etc. Unfunately the JAX-RS code generation does not seem to work. The 1.0 definition is valid according to API Workbench and I can generate live docs correctly with API Console.

Is RAML 1.0 supported by this tooling (I note the Java RAML parser is ready) and if not is there an idea as to when it will be?
Is RAML 1.0 considered production ready or is RAML 0.8 still the official GA release?


#2

So the short answer is…no… or better yet… not yet. I started to dabble on a RAML 1.0 JAXRS generator, but the bigger issue right now is we need a RAML 1.0 Types to POJO generator. We could go on to use JSONSchema2Pojo library and JSON Schema, and that probably should be supported… although me personally, I want to use RAML Types for defining request/response bodies, and generate POJOs. The problem right now is that the internal parser representation of RAML types makes it difficult (if not impossible at this point…still looking into it) to deal with inheritance. A colleague of mine found that you can define a RAML Type A, with prop a, and Type B that extends A, but adds prop b. In the parser, Type B shoes up with both prop a and b in it, and currently it appears there isnt an easy way to determine that prop a came from Type A… the resulting generated POJO would be a Class B with prop a and b defined, instead of Class B extends A with just prop b in it. RAML Types define a nice inheritance capability, but it may be more difficult to translate that to a language like Java. Once we can figure out the best way to proceed with this issue, the rest shouldnt be too hard. Iterating the resources and generating code from those is not that difficult.

The bigger culprit is time. Me personally I have a lot going on so its hard to find time to work on it. I would love to work on it full time till its done, but alas, life, job, and such get in the way!