Repository navigation
[dart-dio] fix the issue of multi layer issues with dart-dio code generation #23717
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
Open
fstotz
wants to merge
59
commits into
OpenAPITools:master
Choose a base branch
from
fstotz:feature/dart_dio_fix_one_of_multi_layers
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
59 commits
Select commit
Hold shift + click to select a range
0396533
fix the issue of multi layer issues with dart-dio code generation
fstotz d9a2139
add files from build
fstotz 7a226bc
docs(dart-dio): add javadocs for discriminator helpers
fstotz e853b43
Merge branch 'master' into feature/dart_dio_fix_one_of_multi_layers
fstotz 6365749
fix possible null cast exception
fstotz d01c5b5
Merge branch 'master' into feature/dart_dio_fix_one_of_multi_layers
fstotz 44f785c
fix issues with parsing of arrays of nullable objects
fstotz fc48bff
Merge branch 'master' into feature/dart_dio_fix_one_of_multi_layers
fstotz 6eed65b
run generate samples
fstotz 2d0e06c
run generate samples
fstotz a67de53
handle required null query params
fstotz b313885
fix json_serializable
fstotz 11075d9
fix onOf anyof combination mapping
fstotz 460b0cb
cleanup
fstotz 6ac19a2
address issue from review
fstotz 3afaa1d
address issue from review
fstotz eebd642
fix: use encodeFormParameter for non-multipart form params and optimi…
fstotz 4c2a1a3
fix(dart-dio): encode array path params properly
fstotz e9d6b64
generate tests
fstotz 90f0a6e
Merge remote-tracking branch 'origin/master' into feature/dart_dio_fi…
fstotz ab446d8
fix(dart-dio): use encodeQueryParameter for non-container path params
fstotz 6902be1
test(dart-dio): regression test for enum path param serialization
fstotz b6074f1
add missing function
fstotz ee15d8b
address review issues
fstotz 0d72599
address review issues
fstotz 790e8ea
Update samples/openapi3/client/petstore/dart-dio/petstore-timemachine…
fstotz f79ec9f
address review issues
fstotz f19e118
adjust mapping
fstotz eb57535
cleanup
fstotz be3ab0a
address comments
fstotz 48be05b
address comments
fstotz 2bdf7bb
address comments
fstotz 0218c56
fix: Dart Dio path_param mustache syntax and collection format handling
fstotz 5927593
fix: Dart Dio path parameter URI encoding for reserved characters
fstotz 6ec0a85
fix: Add missing Dio import to json_serializable api_util
fstotz 9d2defc
fix: Dart Dio enum wire values in path encoding
fstotz 42a4e41
refactor: Simplify Dart Dio enum path encoding implementation
fstotz f39a4cb
test: Add regression test for enum collection path parameter encoding
fstotz a38525f
fix: Make testNonMultipartFormParametersDropNulls test effective
fstotz 3f49873
fix: Dart Dio optional nullable form parameters guard
fstotz dde8641
refactor: Remove test methods referencing non-existent OpenAPI specs
fstotz 81e6795
cleanup
fstotz 6899118
cleanup
fstotz d20318b
Merge remote-tracking branch 'origin/master' into feature/dart_dio_fi…
fstotz ceee1fa
Merge remote-tracking branch 'origin/master' into feature/dart_dio_fi…
fstotz ee4e973
refactor(dart-dio): drop redundant null cleanup
fstotz 8e1895e
fix(dart-dio): JSON-encode model form fields
fstotz 0388896
fix(dart-dio): harden path encoding
fstotz 1e25553
test(dart-dio): fix inheritance fixture
fstotz 07cae53
fix(dart-dio): preserve nullable query keys
fstotz 11c121e
test(dart-dio): assert valid webhook import
fstotz 150bc77
test(dart-dio): retain webhook regressions
fstotz f822c5f
Merge branch 'master' into feature/dart_dio_fix_one_of_multi_layers
fstotz 5d1fc2e
fix(dart-dio): handle iterable path values
fstotz 05fa24e
test(dart-dio): scope form encoding assertion
fstotz 51d52dc
test(dart-dio): cover enum path wire values
fstotz 970e4a3
fix(dart-dio): handle nullable query items
fstotz df01274
fix(dart-dio): preserve query partial spacing
fstotz 04ec471
fix(dart-dio): preserve path partial spacing
fstotz File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
...r/src/main/resources/dart/libraries/dio/serialization/built_value/api/form_param.mustache
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| {{#isContainer}}{{#isMap}}{{#collectionFormat}}encodeParameter(_serializers, {{{paramName}}}, const FullType(BuiltMap, [FullType(String), FullType({{{baseType}}})]), asString: true, format: ListFormat.{{collectionFormat}}){{/collectionFormat}}{{^collectionFormat}}encodeParameter(_serializers, {{{paramName}}}, const FullType(BuiltMap, [FullType(String), FullType({{{baseType}}})])){{/collectionFormat}}{{/isMap}}{{^isMap}}{{#collectionFormat}}encodeParameter<{{{baseType}}}>(_serializers, {{{paramName}}}, const FullType(Built{{#isArray}}{{#uniqueItems}}Set{{/uniqueItems}}{{^uniqueItems}}List{{/uniqueItems}}{{/isArray}}, [FullType({{{baseType}}})]), asString: true, format: ListFormat.{{collectionFormat}}){{/collectionFormat}}{{^collectionFormat}}encodeParameter<{{{baseType}}}>(_serializers, {{{paramName}}}, const FullType(Built{{#isArray}}{{#uniqueItems}}Set{{/uniqueItems}}{{^uniqueItems}}List{{/uniqueItems}}{{/isArray}}, [FullType({{{baseType}}})])){{/collectionFormat}}{{/isMap}}{{/isContainer}}{{^isContainer}}encodeParameter(_serializers, {{{paramName}}}, const FullType({{{dataType}}}), asString: true){{/isContainer}} |
1 change: 1 addition & 0 deletions
1
...r/src/main/resources/dart/libraries/dio/serialization/built_value/api/path_param.mustache
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| {{#isContainer}}{{#isMap}}encodePathParameter(_serializers, {{{paramName}}}, const FullType(BuiltMap, [FullType(String), FullType({{{baseType}}})])){{/isMap}}{{^isMap}}{{#isNullable}}{{{paramName}}} == null ? '' : {{/isNullable}}encodePathParameter(_serializers, {{{paramName}}}, const FullType(Built{{#isArray}}{{#uniqueItems}}Set{{/uniqueItems}}{{^uniqueItems}}List{{/uniqueItems}}{{/isArray}}, [FullType({{{baseType}}})]){{#collectionFormat}}, format: ListFormat.{{collectionFormat}}{{/collectionFormat}}){{/isMap}}{{/isContainer}}{{^isContainer}}encodePathParameter(_serializers, {{{paramName}}}, const FullType({{{dataType}}})){{/isContainer}} | ||
|
cubic-dev-ai[bot] marked this conversation as resolved.
|
||
2 changes: 1 addition & 1 deletion
2
.../src/main/resources/dart/libraries/dio/serialization/built_value/api/query_param.mustache
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1 @@ | ||
| {{#isContainer}}{{#isMap}}encodeQueryParameter{{/isMap}}{{^isMap}}encodeCollectionQueryParameter<{{{baseType}}}>{{/isMap}}{{/isContainer}}{{^isContainer}}encodeQueryParameter{{/isContainer}}(_serializers, {{{paramName}}}, const FullType({{^isContainer}}{{{dataType}}}){{/isContainer}}{{#isContainer}}Built{{#isMap}}Map{{/isMap}}{{#isArray}}{{#uniqueItems}}Set{{/uniqueItems}}{{^uniqueItems}}List{{/uniqueItems}}{{/isArray}}, [{{#isMap}}FullType(String), {{/isMap}}FullType({{{baseType}}})]), {{#collectionFormat}}format: ListFormat.{{collectionFormat}},{{/collectionFormat}}{{/isContainer}}) | ||
| {{#isContainer}}{{#isMap}}encodeParameter(_serializers, {{{paramName}}}, const FullType(BuiltMap, [FullType(String), FullType{{#items.isNullable}}.nullable{{/items.isNullable}}({{{baseType}}})])){{/isMap}}{{^isMap}}encodeParameter<{{{baseType}}}{{#items.isNullable}}?{{/items.isNullable}}>(_serializers, {{{paramName}}}, const FullType(Built{{#isArray}}{{#uniqueItems}}Set{{/uniqueItems}}{{^uniqueItems}}List{{/uniqueItems}}{{/isArray}}, [FullType{{#items.isNullable}}.nullable{{/items.isNullable}}({{{baseType}}})]), omitNullCollectionItems: true{{#collectionFormat}}, format: ListFormat.{{collectionFormat}}{{/collectionFormat}}){{/isMap}}{{/isContainer}}{{^isContainer}}encodeParameter(_serializers, {{{paramName}}}, const FullType({{{dataType}}})){{/isContainer}} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
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.
suggestion: what about adding docstrings explaining what this function and other newly added functions do?
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.
@wing328 I did add some comments and also fixed another issue in regards to a possible null cast
Could you take another look?