Skip to content

[dart] Fix api client deserialization for json_serializable#8882

Merged
wing328 merged 11 commits into
OpenAPITools:masterfrom
agilob:dart-json-serializable-api-client-fix-deserialization-of-objects
Mar 11, 2021
Merged

[dart] Fix api client deserialization for json_serializable#8882
wing328 merged 11 commits into
OpenAPITools:masterfrom
agilob:dart-json-serializable-api-client-fix-deserialization-of-objects

Conversation

@agilob

@agilob agilob commented Mar 3, 2021

Copy link
Copy Markdown
Contributor

Oh boy I hope this works

It works

@kuhnroyal

Comment thread modules/openapi-generator/src/main/resources/dart2/api.mustache
Comment thread samples/client/petstore/dart2/petstore_client_lib/lib/api/user_api.dart Outdated
@agilob

agilob commented Mar 8, 2021

Copy link
Copy Markdown
Contributor Author

I think this is too much of a change and should be more conditional for now... brb

@agilob

agilob commented Mar 8, 2021

Copy link
Copy Markdown
Contributor Author

Class.fromJson is only used in json_serializable not for native

…to dart-json-serializable-api-client-fix-deserialization-of-objects
@agilob

agilob commented Mar 10, 2021

Copy link
Copy Markdown
Contributor Author

@kuhnroyal bump

@kuhnroyal kuhnroyal left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Fine by me

@agilob agilob force-pushed the dart-json-serializable-api-client-fix-deserialization-of-objects branch from b546fd7 to 7759ae1 Compare March 11, 2021 08:44
@agilob

agilob commented Mar 11, 2021

Copy link
Copy Markdown
Contributor Author

Failure in:

[SEVERE] built_value_generator:built_value on lib/model/enum_arrays.dart:
An error `FormatterException` occurred while formatting the generated source for
  `package:openapi/model/enum_arrays.dart`
which was output to
  `lib/model/enum_arrays.built_value.g.part`.
This may indicate an issue in the generator, the input source code, or in the
source formatter.
Could not format because the source could not be parsed:

line 43, column 5: Expected an identifier.
   ╷
43 │ '\\$': 'dollar',
   │     ^
   ╵
line 39, column 15: Expected an identifier.
   ╷
39 │ 'dollar': '\\$',
   │               ^

@kuhnroyal

Copy link
Copy Markdown
Contributor

Ya, #8947 fixed this on master. Just needs a rebuild probably.

@agilob

agilob commented Mar 11, 2021

Copy link
Copy Markdown
Contributor Author

Yup, passed now after pulling master

@wing328 wing328 added this to the 5.1.0 milestone Mar 11, 2021
@wing328 wing328 merged commit b782cff into OpenAPITools:master Mar 11, 2021
@agilob agilob deleted the dart-json-serializable-api-client-fix-deserialization-of-objects branch March 11, 2021 13:50
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.

3 participants