mulesoft-labs / raml-jaxrs-codegen

Tools to enable RAML-first development in JAX-RS projects
Other
40 stars 44 forks source link

Local schemas, path params, include issues #20

Closed jayashe closed 3 years ago

jayashe commented 9 years ago

Fixes https://github.com/mulesoft/raml-jaxrs-codegen/issues/19, path parameter issues also

scholarsmate commented 9 years ago

Thanks for fixing this very annoying issue. I hope it gets merged soon!

scholarsmate commented 9 years ago

Merged this PR into my local copy and 'mvn clean test' now produces the following error:

[INFO] Reactor Summary: [INFO] [INFO] RAML JAX-RS Codegen ............................... SUCCESS [0.143s] [INFO] RAML JAX-RS Codegen Core .......................... SUCCESS [4.323s] [INFO] RAML JAX-RS Maven Plug-in ......................... SUCCESS [1.545s] [INFO] RAML JAX-RS Jersey Example ........................ FAILURE [0.967s] [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 7.112s [INFO] Finished at: Tue Jul 22 14:54:28 EDT 2014 [INFO] Final Memory: 29M/382M [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project raml-jaxrs-jersey-example: Compilation failure: Compilation failure: [ERROR] /mnt/local/davin/git/raml-jaxrs-codegen/jersey-example/src/main/java/org/raml/jaxrs/example/impl/PresentationResource.java:[34,122] cannot find symbol [ERROR] symbol: method withSize(int) [ERROR] location: class org.raml.jaxrs.example.model.Presentations [ERROR] /mnt/local/davin/git/raml-jaxrs-codegen/jersey-example/src/main/java/org/raml/jaxrs/example/impl/PresentationResource.java:[36,64] cannot find symbol [ERROR] symbol: method withId(java.lang.String) [ERROR] location: class org.raml.jaxrs.example.model.Presentation [ERROR] /mnt/local/davin/git/raml-jaxrs-codegen/jersey-example/src/main/java/org/raml/jaxrs/example/impl/PresentationResource.java:[36,22] cannot find symbol [ERROR] symbol: method getPresentations() [ERROR] location: variable presentations of type org.raml.jaxrs.example.model.Presentations [ERROR] /mnt/local/davin/git/raml-jaxrs-codegen/jersey-example/src/main/java/org/raml/jaxrs/example/impl/PresentationResource.java:[49,15] cannot find symbol [ERROR] symbol: method setId(java.lang.String) [ERROR] location: variable entity of type org.raml.jaxrs.example.model.Presentation [ERROR] /mnt/local/davin/git/raml-jaxrs-codegen/jersey-example/src/main/java/org/raml/jaxrs/example/impl/PresentationResource.java:[63,82] cannot find symbol [ERROR] symbol: method withId(java.lang.String) [ERROR] location: class org.raml.jaxrs.example.model.Presentation [ERROR] -> [Help 1]

jayashe commented 9 years ago

@scholarsmate Check out the master of my branch now. You'll need to clone/install this branch of jsonschema2pojo for now.

Some pretty substantial changes, including for the time being: schemas referenced at the top of the RAML file must be !included files as opposed to being embedded into the RAML. This is a result of the way jsonschema2pojo deals with $ref tags (looks for a file, not another schema in the RAML). Also added a property for the maven plugin which defaults to ./schema/ in the same directory that the RAML file exists.

The gradle plugin could also use an update but I don't use gradle.

Also just realized that mulesoft has different coding/formatting standards than I've been using so a lot of the changes are formatting...

KonstantinSviridov commented 9 years ago

Hi, jgashe

I'm working on integrating pull requests of the "mulesoft/raml-jaxrs-codegen" repository. I consider your contribution very valuable. In order to work with it, and finally accept it, I would need you to accept the "MuleSoft Contributor Agreement Acceptance" at https://api-notebook.anypoint.mulesoft.com/notebooks#bc1cf75a0284268407e4 as described in the README of the project.

Thanks for contributing. Regards, Konstantin.