Skip to content

Conversation

@ajeans
Copy link
Contributor

@ajeans ajeans commented Nov 18, 2020

Fast tracked into the Accept header (resttemplate)

See full details at issue #7141
The issue is that the Accept header may use a single mime type rather than all mime types advertized in the spec if it is a JSON mime type.
However, application/problem+json qualifies as a JSON mime type so is fast tracked, but a standard server (e.g. spring boot) will reject a request that only accepts the error responses and not the standard responses.

PR checklist

  • Read the contribution guidelines.
  • Pull Request title clearly describes the work in the pull request and Pull Request description provides details about how to validate the work. Missing information here may result in delayed response from the community.
  • If contributing template-only or documentation-only changes which will change sample output, build the project beforehand.
  • Run the shell script ./bin/generate-samples.shto update all Petstore samples related to your fix. This is important, as CI jobs will verify all generator outputs of your HEAD commit as it would merge with master. These must match the expectations made by your contribution. You may regenerate an individual generator by passing the relevant config(s) as an argument to the script, for example ./bin/generate-samples.sh bin/configs/java*. For Windows users, please run the script in Git BASH.
  • File the PR against the correct branch: master
  • Copy the technical committee to review the pull request if your PR is targeting a particular programming language.

@ajeans
Copy link
Contributor Author

ajeans commented Nov 18, 2020

CC Java Technical Committee @bbdouglas (2017/07) @sreeshas (2017/08) @jfiala (2017/08) @lukoyanov (2017/09) @cbornet (2017/09) @jeff9finger (2018/01) @karismann (2019/03) @Zomzog (2019/04) @lwlee2608 (2019/10) @bkabrda (2020/01)

@wing328
Copy link
Member

wing328 commented Dec 1, 2020

@ajeans thanks for the PR. Can you please run ./bin/utils/ensure-up-to-date to update the samples so that the CI can verify the result?

@wing328 wing328 added this to the 5.0.0 milestone Dec 1, 2020
@ajeans
Copy link
Contributor Author

ajeans commented Dec 1, 2020

@wing328 I just ran the script, but there is nothing to commit after the script ran...

[...]
# START SCRIPT: ./bin/utils/export_generator.sh typescript-aurelia
# START SCRIPT: ./bin/utils/export_generator.sh typescript-fetch
# START SCRIPT: ./bin/utils/export_generator.sh typescript-inversify
# START SCRIPT: ./bin/utils/export_generator.sh typescript-node
# START SCRIPT: ./bin/utils/export_generator.sh typescript-redux-query
# START SCRIPT: ./bin/utils/export_generator.sh typescript-jquery
Executed /home/arnaud/workspace/oss/openapi-generator/bin/utils/export_docs_generators.sh successfully!
Starting /home/arnaud/workspace/oss/openapi-generator/bin/utils/copy-to-website.sh ...
# START SCRIPT: ./bin/utils/export_generator.sh typescript-rxjs
# START SCRIPT: /home/arnaud/workspace/oss/openapi-generator/bin/utils/copy-to-website.sh
Wrote /home/arnaud/workspace/oss/openapi-generator/docs/conduct.md
Wrote /home/arnaud/workspace/oss/openapi-generator/docs/contributing.md
Executed /home/arnaud/workspace/oss/openapi-generator/bin/utils/copy-to-website.sh successfully!
Starting /home/arnaud/workspace/oss/openapi-generator/bin/utils/export_generators_readme.sh ...
# START SCRIPT: /home/arnaud/workspace/oss/openapi-generator/bin/utils/export_generators_readme.sh
Wrote /home/arnaud/workspace/oss/openapi-generator/docs/generators.md
Executed /home/arnaud/workspace/oss/openapi-generator/bin/utils/export_generators_readme.sh successfully!
Git working tree is clean

@ajeans ajeans force-pushed the issue-7141-filter-out-problem-json branch 2 times, most recently from a69cf8b to f3c8eb7 Compare December 1, 2020 18:17
@ajeans ajeans force-pushed the issue-7141-filter-out-problem-json branch from f3c8eb7 to 20a4db8 Compare December 1, 2020 19:26
@ajeans
Copy link
Contributor Author

ajeans commented Dec 1, 2020

Oh right, PEBKAC, I had a stale openapi-generator-cli.jar and ./bin/utils/ensure-up-to-date didn't recreate it anew

Llooking into this, it should have been refreshed by the mvn invocation in bin/generate-samples.sh... weird, will look if I can recreate...

Anyway @wing328 , looks good to me now, rebased on top of master, original commit first on top, then the sample changes...

@ajeans
Copy link
Contributor Author

ajeans commented Dec 1, 2020

And a third commit on top to make sure we use the same method as before.

Spring resttemplate has a isJsonMime(String) and a isJsonMime(MediaType)), keep using the isJsonMime(MediaType) variant

@wing328 wing328 modified the milestones: 5.0.0, 5.0.1 Dec 21, 2020
@wing328
Copy link
Member

wing328 commented Jan 4, 2021

@ajeans thanks for the PR, which looks reasonable to me.

@wing328 wing328 merged commit 0c5cec8 into OpenAPITools:master Jan 4, 2021
@wing328 wing328 changed the title 7141: filter out problem+json mime type from JSON mime types fast tra… [Resttemplate] Filter out problem+json mime type from JSON mime types Jan 4, 2021
@ajeans ajeans deleted the issue-7141-filter-out-problem-json branch January 4, 2021 15:24
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