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

dart-dio improvements #6047

Merged
merged 7 commits into from
May 2, 2020
Merged

dart-dio improvements #6047

merged 7 commits into from
May 2, 2020

Conversation

jaumard
Copy link
Contributor

@jaumard jaumard commented Apr 24, 2020

fix #6044
fix #6026

PR checklist

  • Read the contribution guidelines.
  • If contributing template-only or documentation-only changes which will change sample output, build the project before.
  • Run the shell script(s) under ./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).
  • File the PR against the correct branch: master, 4.3.x, 5.0.x. Default: master.
  • Copy the technical committee to review the pull request if your PR is targeting a particular programming language.

cc @ircecho (2017/07) @swipesight (2018/09) @jaumard (2018/09) @nickmeinhold (2019/09) @athornz (2019/12) @amondnet (2019/12)

@wing328
Copy link
Member

wing328 commented May 1, 2020

If no further feedback on this PR, I'll merge it over the weekend.

@wing328 wing328 added this to the 4.3.1 milestone May 1, 2020
@wing328 wing328 merged commit 7d5695e into OpenAPITools:master May 2, 2020
@wing328
Copy link
Member

wing328 commented May 7, 2020

@jaumard thanks for the PR, which has been included in the v4.3.1 release: https://twitter.com/oas_generator/status/1258057660974329861

michaelpro1 pushed a commit to michaelpro1/openapi-generator that referenced this pull request May 7, 2020
* fix runtime deserialisation

* add security support for dart dio

* regenerate dart dio sample

* update dio pubspec.mustache deps

* check response type before parsing

* add default dateTime serializer

* regenerate sample
@@ -88,12 +88,12 @@ class {{classname}} {

{{#isListContainer}}
final FullType type = const FullType(BuiltList, const [const FullType({{returnBaseType}})]);
BuiltList<{{returnBaseType}}> dataList = _serializers.deserialize(jsonDecode(response.data), specifiedType: type);
BuiltList<{{returnBaseType}}> dataList = _serializers.deserialize(response.data is String ? jsonDecode(response.data) : response.data, specifiedType: type);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After this change, you cannot have a 'text/plain' response, as it tries to apply jsonDecode on it.

:(

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With 'text/plain' response you shouldn't arrived here as you don't need to deserialize at all

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed, but it was trying to deserialize a text/plain response.

MikailBag pushed a commit to MikailBag/openapi-generator that referenced this pull request May 31, 2020
* fix runtime deserialisation

* add security support for dart dio

* regenerate dart dio sample

* update dio pubspec.mustache deps

* check response type before parsing

* add default dateTime serializer

* regenerate sample
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants