Skip to content

Conversation

@amcginn
Copy link
Contributor

@amcginn amcginn commented Aug 10, 2017

PR checklist

  • Read the contribution guidelines.
  • Ran the shell script under ./bin/ to update Petstore sample so that CIs can verify the change. (For instance, only need to run ./bin/{LANG}-petstore.sh and ./bin/security/{LANG}-petstore.sh if updating the {LANG} (e.g. php, ruby, python, etc) code generator or {LANG} client's mustache templates). Windows batch files can be found in .\bin\windows\.
  • Filed the PR against the correct branch: master for non-breaking changes and 3.0.0 branch for breaking (non-backward compatible) changes.

Description of the PR

(details of the change, additional tests that have been done, reference to the issue for tracking, etc)

  • Added logic in the JaxRS Server generator to translate the CodegenResponse return type and container type
  • Updated the JavaJaxRS api.mustache file to correctly output the response type and container type (if applicable)

}, tags={ "fake", })
@io.swagger.annotations.ApiResponses(value = {
@io.swagger.annotations.ApiResponse(code = 400, message = "Invalid username supplied", response = void.class),
@io.swagger.annotations.ApiResponse(code = 400, message = "Invalid username supplied", response = Void.class),
Copy link

@jmatcuk jmatcuk Aug 10, 2017

Choose a reason for hiding this comment

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

Would you revert the formatting changes please.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This was done on purpose as "void.class" is not a class in Java, so I updated it to "Void.class."

Copy link
Contributor

Choose a reason for hiding this comment

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

@amcginn I think that might introduce a minor issue:

--- a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/api/PetApi.java
+++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/api/PetApi.java
@@ -32,7 +32,7 @@ public interface PetApi  {
     @ApiOperation(value = "Add a new pet to the store", tags={ "pet",  })
     @ApiResponses(value = { 
         @ApiResponse(code = 405, message = "Invalid input") })
-    public void addPet(@Valid Pet body);
+    public Void addPet(@Valid Pet body);

void becomes Void in the method signature and the code won't compile.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I ran the jaxrs-cxf-petstore-server.sh while on master and this happened as well.

@amcginn amcginn force-pushed the jaxrs-fix-annotations branch from 6983fb8 to b4d9c68 Compare August 27, 2017 08:48
@amcginn
Copy link
Contributor Author

amcginn commented Aug 29, 2017

Closing as this was addressed by another PR: #6373

@amcginn amcginn closed this Aug 29, 2017
@amcginn amcginn deleted the jaxrs-fix-annotations branch December 27, 2017 04:10
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.

3 participants