Skip to content

[Java][Spring] Add examples defined in the spec to Spring MVC server generator #5411

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

Merged
merged 5 commits into from
Apr 18, 2017

Conversation

wing328
Copy link
Contributor

@wing328 wing328 commented Apr 18, 2017

PR checklist

  • Read the contribution guidelines.
  • Ran the shell/batch 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)
  • Filed the PR against the correct branch: master for non-breaking changes and 2.3.0 branch for breaking (non-backward compatible) changes.

Description of the PR

For #5310.

Credits also go to @Elizabett, @cbornet

@wing328
Copy link
Contributor Author

wing328 commented May 2, 2017

@kenjones-cisco because we need to determine the "Accept" in the HTTP request so as to return the response based on the format specified in "Accept".

Is it causing issue to your application?

@kenjones-cisco
Copy link
Contributor

@wing328 Thanks for the explanation.

@wing328
Copy link
Contributor Author

wing328 commented May 2, 2017

@kenjones-cisco I think about this a bit more and this is breaking change that should go to 2.3.0 (a branch with breaking changes) instead as the method signature has changed. (we want to avoid breaking changes to the current master)

I'm sorry for the inconvenience caused by this.

I'll file a PR to revert the change in the master and submit the change against 2.3.0 instead by coming Thursday.

cc @Elizabett, @cbornet

@wing328 wing328 restored the elizabetht-issue-5310 branch May 5, 2017 09:19
@wing328
Copy link
Contributor Author

wing328 commented May 9, 2017

I'll file a PR to revert the change in the master and submit the change against 2.3.0 instead by coming Thursday.

Due to busy schedule, I'll revert the change tomorrow instead.

@wing328
Copy link
Contributor Author

wing328 commented May 10, 2017

@kenjones-cisco the change has been rolled back via #5599

I'll file a separate PR to make the enhancement in 2.3.0 branch.

@wing328
Copy link
Contributor Author

wing328 commented May 10, 2017

#5606 merged into 2.3.0 to provide the same enhancment to Spring generators.

@elizabetht @kenjones-cisco please kindly pull the latest master and 2.3.0 to give it a try.

davidgri pushed a commit to davidgri/swagger-codegen that referenced this pull request May 11, 2017
[Java][Spring] Add examples defined in the spec to Spring MVC server generator
@wingsofovnia
Copy link
Contributor

Hi @wing328 !
In my application, where I'm using codegen for generating api intefaces (only) dynamically during build, @RequestHeader("Accept") String accept is a breaking change. As far as I can see, it's only used in a Controller stub. Can we consider disabling this param for interfaceOnly config enabled?

@wing328
Copy link
Contributor Author

wing328 commented Oct 15, 2017

Can we consider disabling this param for interfaceOnly config enabled?

@wingsofovnia sounds reasonable to me. Please submit a PR so that we can review the change.

@cbornet
Copy link
Contributor

cbornet commented Oct 15, 2017

I think there is a better way : instead of using RequestHeader, the header can be retrieved from ((ServletRequestAttributes)RequestContextHolder.getRequestAttributes()).getRequest().getHeader("Accept"). This way the API would be the same for all implementations and cleaner IMO.

@cbornet
Copy link
Contributor

cbornet commented Oct 15, 2017

And we can do it on the master since the change is non-breaking

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.

5 participants