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
If an enum is defined as integer values in the swagger json file, and a property in your model is defined as a list of that enum, the method generated to convert an enum list from json fails to find the correct value and returns only a list of swaggerGeneratedUnknown for all values in the list, this is due to the method [enumName]ListFromJson converts the enum value property to String before sending it to [enumName]FromJson. See example below
When someEnumListFromJson is called, it converts the values of propertyName to String and send them to someEnumFromJson which fails to find the correct value due the type mismatch.
I'm temporarily manually modifying the generated code.
If I'm missing any setting I'd appreciate any guidance on getting this to work.
The text was updated successfully, but these errors were encountered:
If an enum is defined as
integer
values in the swagger json file, and a property in your model is defined as a list of that enum, the method generated to convert an enum list from json fails to find the correct value and returns only a list ofswaggerGeneratedUnknown
for all values in the list, this is due to the method[enumName]ListFromJson
converts the enumvalue
property toString
before sending it to[enumName]FromJson
. See example belowSwagger json snippet:
This will generate the following code:
Now, if your swagger contains a model with a property defined as
List<SomeEnum>
, it will generate the code as:When
someEnumListFromJson
is called, it converts the values ofpropertyName
to String and send them tosomeEnumFromJson
which fails to find the correct value due the type mismatch.I'm temporarily manually modifying the generated code.
If I'm missing any setting I'd appreciate any guidance on getting this to work.
The text was updated successfully, but these errors were encountered: