Skip to content
This repository has been archived by the owner on Feb 12, 2022. It is now read-only.

NullPointerException with a certain RAML #265

Closed
haba713 opened this issue May 28, 2017 · 8 comments
Closed

NullPointerException with a certain RAML #265

haba713 opened this issue May 28, 2017 · 8 comments
Projects

Comments

@haba713
Copy link

haba713 commented May 28, 2017

raml-to-jaxrs-cli throws NullPointerException when I try to generate JAX-RS classes from this RAML which is downloaded with all the schema files into directory src/main/raml.

ramltojaxrs -d src/main/gen-java src/main/raml/root-resource-v1.raml

Exception in thread "main" java.lang.NullPointerException
at org.raml.jaxrs.generator.v08.V08Finder.typesInBodies(V08Finder.java:106)
at org.raml.jaxrs.generator.v08.V08Finder.resourceTypes(V08Finder.java:81)
at org.raml.jaxrs.generator.v08.V08Finder.resourceTypes(V08Finder.java:78)
at org.raml.jaxrs.generator.v08.V08Finder.resourceTypes(V08Finder.java:78)
at org.raml.jaxrs.generator.v08.V08Finder.findTypes(V08Finder.java:59)
at org.raml.jaxrs.generator.CurrentBuild.constructClasses(CurrentBuild.java:259)
at org.raml.jaxrs.generator.RamlScanner.handle(RamlScanner.java:106)
at org.raml.jaxrs.generator.RamlScanner.handle(RamlScanner.java:72)
at org.raml.jaxrs.generator.RamlScanner.handle(RamlScanner.java:55)
at org.raml.jaxrs.ramltojaxrs.Main.main(Main.java:75)

I've tested with 2.0.0 and HEAD.

@haba713 haba713 changed the title NullPointerException with Posti SmartShip RAML NullPointerException with a certain RAML May 28, 2017
@jpbelang
Copy link
Contributor

Could you provide a whole example with the problem please ?

@haba713
Copy link
Author

haba713 commented May 29, 2017

Do you mean steps to reproduce the issue? They're here:

  1. Clone and compile raml-for-jax-rs 2.0.0.
  2. Copy https://smartship.unifaun.com/rs-extapi/v1/documentation/root-resource-v1.raml into src/raml
  3. Create output directory src/java
  4. Execute org.raml.jaxrs.ramltojaxrs.Main with the following arguments:
    -d src/java src/raml/root-resource-v1.raml
  5. See the resulting NPE with stacktrace.

Should I copy also the schema files referred in RAML into src/raml?

@jpbelang
Copy link
Contributor

yeah, send everything, like in a zip file. It'll save me some time.

Thanks.

@haba713
Copy link
Author

haba713 commented Jun 22, 2017

See the folder raml-to-jaxrs/examples/maven-examples/posti-smartship in raml-for-jax-rs.zip

@rckrsc
Copy link

rckrsc commented Jul 26, 2017

Hey,
I'm facing the same issue during generation with this RAML file.

@cjmamo
Copy link

cjmamo commented Aug 17, 2017

Any updates on this issue? I'm having the same problem with version 2.1.0.

jpbelang added a commit that referenced this issue Aug 30, 2017
Don't like the fix, but it will do.  I hate nulls.
@jpbelang
Copy link
Contributor

jpbelang commented Aug 30, 2017

Changed your pom file to have this:

                    <resourcePackage>resources</resourcePackage>
                    <modelPackage>model</modelPackage>

jpbelang added a commit that referenced this issue Aug 30, 2017
Second fix for second person.  Null bodies this time.
@jpbelang
Copy link
Contributor

@Rigoros fixed for your raml. It was null bodies.

@claudemamo give it a shot.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
No open projects
2.1.1
  
Done
Development

No branches or pull requests

5 participants