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
AllowedValues and DefaultValue(..) should be setting the values according to the data type. Right now, .AllowedValues(...) accepts a map[string]string as the param and the swagger generated is always an enum of strings even if the datatype is boolean or integer.
As for DefaultValue, it accepts a string but it attempts to auto-detect the type despite the data type already being set. So if the DataType is "string" and the default value is set to "1", it will convert it to an integer!
This results in the default value having a different data type than the allowedvalues which is an invalid swagger.
AllowedValues
andDefaultValue(..)
should be setting the values according to the data type. Right now,.AllowedValues(...)
accepts a map[string]string as the param and the swagger generated is always an enum of strings even if the datatype is boolean or integer.As for
DefaultValue
, it accepts a string but it attempts to auto-detect the type despite the data type already being set. So if the DataType is "string" and the default value is set to "1", it will convert it to an integer!This results in the default value having a different data type than the allowedvalues which is an invalid swagger.
Example 1:
Setting the following:
results in
But what we want is:
Example 2:
Results in
But we want:
The text was updated successfully, but these errors were encountered: