-
Notifications
You must be signed in to change notification settings - Fork 58
Open
Description
We have the following setup:
- Enums with values that are based on ints (generated with https://github.com/klippa-app/go-enum)
- The enums values have a string representation that we use for JSON, generated/parsed by MarshalJSON and UnmarshalJSON
- We use the DataType interface to tell OpenAPI it's actually a string and not an int
- When you do this, an enum consisting of string values can't be added to the struct property, because the validation logic will use the original type for validation, and not the overriden type with the DataType interface.
For us there would be 2 valid solutions:
- Make the validator aware of DataType and use that to check the enum value
- Make another interface that returns the possible enum values for a type, this would actually make it very easy for us because then we can just add that to the go-enum generator
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels