-
-
Notifications
You must be signed in to change notification settings - Fork 6.4k
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
[dart] Improve content-type handling #9517
Conversation
@themisir Do you mind testing this for your use-case? |
Do I have a chance to test this without having to clone & re-building the project? |
I don't think so, can't find the artifacts anywhere. |
Yes it works. But why don't you directly generating code as |
I am not sure this is possible in the template but I will check. In any case, they are now correctly ordered in a way that works. |
In my implementation, I introduced a vendorExtensions called But yeah, they are correctly ordered now. |
@themisir I changed this to use only the first content-type. |
* fixes OpenAPITools#9334 * superseeds OpenAPITools#9454 * use `prioritizedContentTypes` in the same way `JavaClientCodegen` does * move `application/json` to the front if it exists * don't do anything if it is multi-part or url-encoded as for this the first content-type already needs to match * log warning if an unsupported content-type is first after prioritizing * remove some unused code blocks from dio generators
* don't default to any content-type in dio-next, dio defaults itself to JSON
b1ca39a
to
424cc29
Compare
* [dart] Improve content-type handling * fixes OpenAPITools#9334 * superseeds OpenAPITools#9454 * use `prioritizedContentTypes` in the same way `JavaClientCodegen` does * move `application/json` to the front if it exists * don't do anything if it is multi-part or url-encoded as for this the first content-type already needs to match * log warning if an unsupported content-type is first after prioritizing * remove some unused code blocks from dio generators * Only use first prioritized content-type in dio generators * don't default to any content-type in dio-next, dio defaults itself to JSON
prioritizedContentTypes
in the same wayJavaClientCodegen
doesapplication/json
to the front if it existsPR 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.1.x
,6.0.x
CC @swipesight (2018/09) @jaumard (2018/09) @josh-burton (2019/12) @amondnet (2019/12) @sbu-WBT (2020/12) @kuhnroyal (2020/12) @agilob (2020/12)