-
-
Notifications
You must be signed in to change notification settings - Fork 6.7k
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-dio] Serializes request bodies using a specific serializer #6384
[dart-dio] Serializes request bodies using a specific serializer #6384
Conversation
@josh-burton What is missing to get this merged? |
abbf0d7
to
f96b90b
Compare
I think CI is failing because of outdated samples, but I'm not sure how to generate new samples as the process seems to have changed. |
72a7a06
to
b16d4b1
Compare
@@ -126,7 +128,9 @@ class FakeApi { | |||
List<String> contentTypes = ["application/json"]; | |||
|
|||
|
|||
var serializedBody = _serializers.serialize(body); | |||
|
|||
var bodySerializer = _serializers.serializerForType(bool); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this work or does this need extra handling for primitives?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After looking at the StandardJsonPlugin, I think this needs special handling for primitives. Probably a plain jsonEncode without any serializer?
Something went wrong with the merge :o |
c068cec
to
7843a77
Compare
@josh-burton Can you update again so we can merge this before monday? |
7843a77
to
c5e7cce
Compare
Travis CI failure not related to this change. |
This happened due to the merge of OpenAPITools#6384 where implicit-dynamics were still allowed.
This happened due to the merge of #6384 where implicit-dynamics were still allowed.
Serializes request bodies using a specific serializer so a discriminator is not added
When using the generic
serialize
method, built value will add a descriminator to the serialized json. For APIs with strict parsing, this causes parsing errors.By finding the specific serializer for the type built value omits the descriminator.
PR checklist
./bin/
(or Windows batch scripts under.\bin\windows
) to update Petstore samples related to your fix. This is important, as CI jobs will verify all generator outputs of your HEAD commit, and these must match the expectations made by your contribution. You only need to run./bin/{LANG}-petstore.sh
,./bin/openapi3/{LANG}-petstore.sh
if updating the code or mustache templates for a language ({LANG}
) (e.g. php, ruby, python, etc).master
,4.3.x
,5.0.x
. Default:master
.CC: @ircecho @swipesight @jaumard @amondnet