Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes for JAXRS-CXF Codegen #2256

Merged
merged 4 commits into from
Mar 2, 2016
Merged

Fixes for JAXRS-CXF Codegen #2256

merged 4 commits into from
Mar 2, 2016

Conversation

hiveship
Copy link
Contributor

i'm the original author of the CXF Codegen. I've made some updates. I'm now using this codegen in a project, it's OK.

  • Add support for CXF 2 (see notes for the Interface Comparator). This Codegen now supports CXF 2 & 3
  • Fix bugs for unmarshalling models (tested with Jackson v1 & v2)
  • Fix some other critical bugs (this bugs shows that nobody was actually using this Codegen)

@wing328
Copy link
Contributor

wing328 commented Feb 27, 2016

```

This is no longer necessary if you are using CXF >=v3.x

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I found some grammatical mistakes and make an update in another commit.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK thank you. I also updated the file to remove my company name in the 'CXFInterfaceComparator' package. Pease, include it.

@wing328
Copy link
Contributor

wing328 commented Feb 28, 2016

Got an error testing the PR:

(venv)swagger-codegen|fix-cxf-codegen ⇒ ./bin/jaxrs-cxf-petstore-server.sh 
reading from modules/swagger-codegen/src/test/resources/2_0/petstore.json
[main] INFO io.swagger.codegen.AbstractGenerator - writing file /private/var/tmp/pr/hiveship/swagger-codegen/samples/server/petstore/jaxrs-cxf/gen/java/io/swagger/model/User.java
[main] INFO io.swagger.codegen.AbstractGenerator - writing file /private/var/tmp/pr/hiveship/swagger-codegen/samples/server/petstore/jaxrs-cxf/gen/java/io/swagger/model/Category.java
[main] ERROR io.swagger.codegen.AbstractGenerator - JavaJaxRS/cxf/enumClass.mustache (No such file or directory)
Exception in thread "main" java.lang.RuntimeException: Could not generate model 'Pet'
    at io.swagger.codegen.DefaultGenerator.generate(DefaultGenerator.java:268)
    at io.swagger.codegen.cmd.Generate.run(Generate.java:188)
    at io.swagger.codegen.SwaggerCodegen.main(SwaggerCodegen.java:36)
Caused by: java.lang.RuntimeException: can't load template JavaJaxRS/cxf/enumClass.mustache
    at io.swagger.codegen.AbstractGenerator.getTemplateReader(AbstractGenerator.java:63)
    at io.swagger.codegen.DefaultGenerator$1.getTemplate(DefaultGenerator.java:237)
    at com.samskivert.mustache.Mustache$IncludedTemplateSegment.execute(Mustache.java:663)
    at com.samskivert.mustache.Mustache$BlockSegment.executeSegs(Mustache.java:718)
    at com.samskivert.mustache.Mustache$SectionSegment.execute(Mustache.java:742)
    at com.samskivert.mustache.Mustache$BlockSegment.executeSegs(Mustache.java:718)
    at com.samskivert.mustache.Mustache$SectionSegment.execute(Mustache.java:738)
    at com.samskivert.mustache.Template.executeSegs(Template.java:92)
    at com.samskivert.mustache.Mustache$IncludedTemplateSegment.execute(Mustache.java:674)
    at com.samskivert.mustache.Mustache$BlockSegment.executeSegs(Mustache.java:718)
    at com.samskivert.mustache.Mustache$InvertedSegment.execute(Mustache.java:770)
    at com.samskivert.mustache.Mustache$BlockSegment.executeSegs(Mustache.java:718)
    at com.samskivert.mustache.Mustache$SectionSegment.execute(Mustache.java:753)
    at com.samskivert.mustache.Mustache$BlockSegment.executeSegs(Mustache.java:718)
    at com.samskivert.mustache.Mustache$SectionSegment.execute(Mustache.java:738)
    at com.samskivert.mustache.Template.executeSegs(Template.java:92)
    at com.samskivert.mustache.Template.execute(Template.java:69)
    at com.samskivert.mustache.Template.execute(Template.java:60)
    at io.swagger.codegen.DefaultGenerator.generate(DefaultGenerator.java:242)
    ... 2 more

Please update the Petstore samples for jaxrs-cxf as well.

@hiveship
Copy link
Contributor Author

I've take a look this mornig and I don't see why this bug occurs (CXFCodegen, JAXRSCodegen & Java Codegen don't import 'enumClass.mustache'). I'm currently using this version on some of my projects (that use enums class and I don't have any problem.
I don't have time to investigate more today and I'll correct it as soon as possible.

@hiveship
Copy link
Contributor Author

wing328 commented 2 days ago
@hiveship your first commit hiveship@37e62b8 is not linked to your github account and therefore that won't count as your contribution in https://github.com/swagger-api/swagger-codegen/graphs/contributors.

Updated.

@wing328
Copy link
Contributor

wing328 commented Feb 29, 2016

@hiveship please take your time. Let me know after you've updated it and thenI'll give it another try.

@hiveship
Copy link
Contributor Author

hiveship commented Mar 1, 2016

@wing328 Could you please retry ? I just added a commit and the sample generation is OK for me.

wing328 added a commit that referenced this pull request Mar 2, 2016
@wing328 wing328 merged commit 18262c1 into swagger-api:master Mar 2, 2016
@hiveship hiveship deleted the fix-cxf-codegen branch March 2, 2016 12:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants