[kotlin] Recognize more json media types in response#10176
[kotlin] Recognize more json media types in response#10176sheepdreamofandroids wants to merge 2 commits intoOpenAPITools:masterfrom
Conversation
|
I don't think the failure in AppVeyor is related to my changes. |
|
Hi, thanks for opening this PR. |
|
Hi @4brunu . My only experience with vendor specific mediatypes is an in-house api using one. There is some documentation here: https://www.rfc-editor.org/rfc/rfc6838.html#section-4.2.8 which suggests that the used condition should work. Alternatively maybe even only checking for a "/json" or "+json" suffix would be enough. But I prefer another PR if that is ever necessary. This PR is actually a subset of the changes we made to the templates that are running in production here. The other changes are about the same change for the request body and sending requests fully asynchronous. Those will be separate PR's. |
|
I see that I made a mistake when copying some of the changes. |
Instead of matching the mediatype against "application/json" it now matches with "application/*json" so vendor specific json mediatypes like "application/vnd.shopping.cart.v2+json" will also be recognized and deserialized. It doesn't map mediatypes to different models.
This would accept malformed mediatypes as well but that doesn't seem harmful.
I'm using a similarly patched template in a project.
PR checklist
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.
master(5.3.0),6.0.x@jimschubert
@dr4ke616
@karismann
@Zomzog
@andrewemery
@4brunu
@yutaka0m