You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Running swagger-dart-code-generator on this json results in the ExampleDTO having a generic Object? examples field instead of Map<String, List<EmbeddedExampleDTO>> examples described in the swagger file.
So, we double-checked this issue and seems Expected result is not achievable.
If a property has additional properties it means that it's a dictionary.
For example for that case(see below), we see 2 properties, "default": "string", and a list of Models and because it's the dictionary we cannot generate a regular model or Map<String, List<EmbeddedExampleDTO>>. It should be simple Map<String, dynamic> in my understanding.
Describe the bug
Using "additionalProperties" in a definition causes the generated field to be of type
Object
.To Reproduce
The swagger json can be found in this example on swaggerhub.
Running
swagger-dart-code-generator
on this json results in theExampleDTO
having a genericObject? examples
field instead ofMap<String, List<EmbeddedExampleDTO>> examples
described in the swagger file.Here is a snippet from the generated Dart class:
Expected behavior
The
example
field should be generated asMap<String, List<EmbeddedExampleDTO>> examples
.For example, the
Export > Client SDK > Dart
function on SwaggerHub seems to generate a proper implementation:Library version used:
swagger_dart_code_generator: ^2.3.2
Additional context
I noticed that this problem was already referenced in #58 which was closed with the message "fixed all issues in 1.2.0 version".
The text was updated successfully, but these errors were encountered: