Example in java jaxrs-to-raml


#1

I don’t find any complete example to use jaxrs-to-raml in java.

Input: ApiRest.java
Output: String json

Thank you


#2

Hi ApiDeveloper, actually there are some:

RAML->Java examples

Java->RAML

Regards,
Pavel


#3

Thanks Pavel,

I already saw those examples but they use maven instead of making the parser in a java class that I need.

I expected a main class with the transformation to create a raml definition on the fly.

Could you send me that kind of sample?

Regards


#4

I guess what you need is RuntimeRAMLBuilder class. You may see example of using it in BasicTest

Regards,
Pavel


#5

Yes, thank you.

But, the problem is when there are any entity in the method throws a nullpointperexception.
The BasicTest is too basic and works fine, BUT if it’s included another example doesn’t work:

@POST
public void post(Entity entity)

Thanks


#6

Yep, There is a bug in the code. :frowning: You may try to use raml1.0 branch in my fork https://github.com/petrochenko-pavel-a/raml-for-jax-rs whish should not suffer from this issue, but it is still pretty new, so you may expect another kinds of issues there)

Regards,
Pavel