Any tool to convert RAML to JAX-RS



Are there tools available to convert RAML to JAX-RS?


Hi @DarVar,

I know that there are some JAX-RS tools in the works right now, but I’m not sure where they stand. I will let you know when I have more info.

In the meantime - welcome to the RAML community! What are you hoping to do with RAML + JAX-RS?



I guess my ideal workflow would be to design my REST API using RAML, Then use the RAML file to generate a template JAX-RS 1.x or 2.x Service and Client to get me started.

There is already a Maven plugin to convert WADL to JAX-RS. SO something similar would be great.


@ddossot is working on some very relevant stuff here…


The project I’m currently working on generates JAX-RS 1.x annotated interfaces in order to enable a RAML-first approach for API creation. It’s currently server-side only, but could be extended to support client-side as well.

As a side note, in term of developer tooling, the RAML support for SOAPui is worth checking:


Hi @ddossot,

Is this project on GitHub?


Not yet but … coming soon!


Hey all: @ddossot’s slick new RAML --> JAX-RS codegen project is now open on github! Find a link to it as well as a description on the projects page or go directly to github. It’s very early, but quite useful already. Feedback is always appreciated.


When I try to build this project , it’s always failing with the following error.

[WARNING] The POM for org.raml.jaxrs:jaxrs-code-generator:jar:2.1.0 is missing, no dependency information available


@drajareddy: can you show us your POM?


POM file is already there in the folllowing project , can you guide me how to execute this project and verify the result


Are you creating your own project with a POM that has a dependency entry for the raml-for-jax-rs project? Or what are you doing exactly?


I am not creating any new project , I have checked out the RAML-FOR-JAX-RS project into my eclipse and try to run this project in my machine and see how it is generating POJO’s . My requirement is to generate POJO’s from RAML file to use it in my project to consume data (Json) coming from other application who provided me RAML.

Thanks in advance.


Did you have a chance to look at the documentation?


@christian_vogel yes I have tried this example , in this example RAML has JSONSchema which is used to convert to POJO’s but RAML 1.0 does not have JSonschema to convert to POJO’s

Thanks alot for your replay.


What do you mean RAML 1.0 does not have JSON Schema? It does.

Are you referring to the tool not converting JSON Schema into POJO’s?


Here is my RAML file sample provided by vender , I want generate a code to consume data from them . can you please suggest me how do I create a client and POJO’s from this RAML.

#%RAML 1.0 DataType

type: object
  actionCode?: string
  id: string
  name: string
  desc?: string
  type: string
  group?: string
  status?: string
  created?: datetime
  createdBy?: string
  lastModified?: datetime
  lastModifiedBy?: string
  lastActivityDate?: datetime
  vintage: string
  exclusiveSaleCountry?: string []
  priceListCode?: string[]
  numberPerCase: number
  volumeSize?: string
  productHierarchy: number
    type: array
    items: !include product-characteristic.raml
example: !include ../examples/product-request-example.raml


There is a bit missing here. The RAML you posted does only describe a data model, but not the API.

You need the actual description of the API and provide that to the generator. For example:

#%RAML 1.0
title: My API


The above example is a description for an API. This can include other files like the data model you posted to also describe the payload. Do you have such a file?


Here is the root RAML

#%RAML 1.0

title: aaaaaaaxxx
version: v1

#mediaType: application/json

collection: !include common/resourceTypes/collection.raml
item: !include common/resourceTypes/item.raml

type: !include dataTypes/product.raml
example: |
“message” : “The resource has been created.”


@drajareddy: I see you’ve been looking at the simple-json-example which has a JSON schema but no RAML types. If you’re looking for an example with RAML types, you might want to take a look at raml-defined-example.

Note that you can run each of these examples by executing $ mvn exec:java as described in the README of the Maven examples. In that same README, there is a list of configuration parameters, the one you’ll probably want to check is generateTypesWith which controls how (RAML) types are translated in the generated code. Hope this helps.