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
We have the following setup:
For us there would be 2 valid solutions: