Open zjarkov opened 8 years ago
@wing328 Looking at the code here all enum values are treated as strings. How should maps be handled? Should it just check the values are a subset of the enumerator values?
@scottrw93 yes, for Python enum, it needs some work to make it support integer enum similar to what we've done for Java, PHP, etc.
For containers (map, list), it should check to ensure the values are a subset of the enumerator values.
@zjarkov 2.3.0 branch has better support for enum in Python API client. Please give that a try and see if you still encounter the same issue.
Hi @wing328
Still have issue with integer enums in Python.
My example:
properties:
simCard:
type: "integer"
format: "int32"
enum: [1, 2]
default: 1
required: false
After code generation I'm getting a valid object of enum:
But a constructor of object with this enum is generated with invalid value:
@moleksyuk Thanks for tagging me but I'm no longer involved in this project. I hope others will be able to help you out. Good luck.
Description
Data type of enum items in Python generated code for property setter does not match to given yaml/json datatype (and/or expected type of property). It leads to permanent validation failures.
Swagger-codegen version
2.2.1
Swagger declaration file content or url
yaml
json
Produced code
Expected code
Command line used for generation
So far used/generated via swagger-editor (generator)