We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
When using a spec that defines a schema of an object containing string keys and string array values the generator produces invalid Dart code.
To reproduce, create a new flutter project and set up openapi_generator with the following spec:
openapi_generator
{ "openapi": "3.0.1", "info": { "title": "Test API", "version": "1.0" }, "paths": { "/Test": { "get": { "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TestDto" } } } } } } } }, "components": { "schemas": { "TestDto": { "required": [ "values" ], "type": "object", "properties": { "values": { "type": "object", "additionalProperties": { "type": "array", "items": { "type": "string" } } } }, "additionalProperties": false } } } }
The generated code should be able to compile.
The code should have the following differences:
return TestDto( values: json[r'values'] == null ? const {} - : mapCastOfType<String, List>(json, r'values'), + : mapCastOfType<String, List<String>>(json, r'values') ?? {}, );
No response
macOS
5.0.2
3.16.9
stable
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Description of the bug
When using a spec that defines a schema of an object containing string keys and string array values the generator produces invalid Dart code.
Steps to reproduce
To reproduce, create a new flutter project and set up
openapi_generator
with the following spec:Expected behavior
The generated code should be able to compile.
The code should have the following differences:
Logs
No response
Screenshots
Platform
macOS
Library version
5.0.2
Flutter version
3.16.9
Flutter channel
stable
Additional context
No response
The text was updated successfully, but these errors were encountered: