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

[Java] Interpret consumes '*/*' as 'application/json' #6175

Merged
merged 1 commit into from
Jul 26, 2017

Conversation

lwander
Copy link
Contributor

@lwander lwander commented Jul 25, 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.

I'm having trouble with the ./bin/java-petstore-all.sh script since it's introducing a lot of changes unrelated to this change, even when I run against upstream/master with no changes staged. It seems like at some point changes to the templates were not checked in alongside their changes to the petstore examples.

Description of the PR

Servers can describe their desired (consumed) content type for an operation as "/", which the current swagger API sends as the content type for any request against that operation. This is troublesome because "/" provides no info to the server as to what is being sent. Given that swagger already defaults to "application/json", this seems appropriate.

@wing328
Copy link
Contributor

wing328 commented Jul 26, 2017

@lwander thanks for the PR. The change is for "jersey1.x" Java API client but I believe Kubernetes is using the default (okhttp-gson): https://github.com/kubernetes-client/java/blob/master/kubernetes/pom.xml#L198

I'll file a PR shortly to add the enhancement to other Java's ApiClient.mustache (some other generators such as Ruby, PHP also have such enhancements but we'll review again to ensure all generators have the same enhancement in place)

@wing328 wing328 merged commit 44e7b5d into swagger-api:master Jul 26, 2017
@wing328
Copy link
Contributor

wing328 commented Jul 26, 2017

FYI. Filed #6188 for other Java API clients.

@lwander
Copy link
Contributor Author

lwander commented Jul 31, 2017

Thanks @wing328, I appreciate all the help

@lwander lwander deleted the fix-content-type-any branch July 31, 2017 14:13
@chlung
Copy link

chlung commented Aug 7, 2017

@wing328 Do you know when v2.3.0 will be released. thanks.

@wing328
Copy link
Contributor

wing328 commented Aug 7, 2017

@chlung we hope to release it by the end of Aug.

@chlung
Copy link

chlung commented Aug 7, 2017

@wing328 thanks. If we would like to try v2.3.0 locally to build k8s-client java api, do you know the procedures/steps to do that?

@wing328
Copy link
Contributor

wing328 commented Aug 7, 2017

Please try the snapshot version: https://github.com/swagger-api/swagger-codegen#compatibility

@chlung
Copy link

chlung commented Aug 7, 2017

@wing328 thanks

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.

None yet

3 participants