We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Currently only string values are supported for enums. Is there a reason why this limitation exists?
Creation of StringSchema for enum types: https://github.com/swagger-api/swagger-core/blame/dc8785efc71c243eebf1ad57dd612cc75112d351/modules/swagger-core/src/main/java/io/swagger/v3/core/jackson/ModelResolver.java#L309
StringSchema
Props are only added if schema is of type StringSchema: https://github.com/swagger-api/swagger-core/blame/dc8785efc71c243eebf1ad57dd612cc75112d351/modules/swagger-core/src/main/java/io/swagger/v3/core/jackson/ModelResolver.java#L1220-L1223
Please add support for enums like this:
public enum MyEnumInteger { FIRST(1), SECOND(2), THIRD(3); @JsonCreator MyEnumInteger(int value) { this.value = value; } @JsonValue private int value; public int getValue() { return value; } public void setValue(int value) { this.value = value; } }
Expected result:
"MyEnumInteger": { "type": "integer", "format": "int32", "enum": [ 1, 2, 3 ] }
Actual result:
"MyEnumInteger": { "type": "string", "enum": [ "1", "2", "3" ] }
The text was updated successfully, but these errors were encountered:
Successfully merging a pull request may close this issue.
Currently only string values are supported for enums. Is there a reason why this limitation exists?
Creation of
StringSchema
for enum types:https://github.com/swagger-api/swagger-core/blame/dc8785efc71c243eebf1ad57dd612cc75112d351/modules/swagger-core/src/main/java/io/swagger/v3/core/jackson/ModelResolver.java#L309
Props are only added if schema is of type
StringSchema
:https://github.com/swagger-api/swagger-core/blame/dc8785efc71c243eebf1ad57dd612cc75112d351/modules/swagger-core/src/main/java/io/swagger/v3/core/jackson/ModelResolver.java#L1220-L1223
Please add support for enums like this:
Expected result:
Actual result:
The text was updated successfully, but these errors were encountered: