Skip to content

[REQ] v2 swagger spec, some defaults unset in models #1748

@spacether

Description

@spacether

Is your feature request related to a problem? Please describe.

When defining default values in the swagger spec, they are only used as defaults in the python client models if the type of the variable is a string or boolean.

Describe the solution you'd like

Please include those default arguments in the python models.
Please also include type checking validation of the input so if the user assigns an incorrectly typed value to a field, the model will throw an error.
Note: I will work on this feature.

Describe alternatives you've considered

Manually assign values all the time. This is possible but not preferred. If we define a default in the spec, it should be used.

Additional context

This appears to be caused by java code from the swagger-api organization. I have opened issues with them at:
swagger-api/swagger-core#3065
swagger-api/swagger-parser#971

I will work on adding this feature prior to working on: #1715

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions