-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Closed
kongchen/swagger-maven-plugin
#675Description
| Q | A |
|---|---|
| Bug or feature request? | Bug |
| Which Swagger-Core version? | 1.5.18 |
| Which Java version? | 1.8u151 |
| Which JAX-RS framework & version? | RESTEasy 3.0.19 with JAX-RS 2.0 |
Using @JsonProperty to override enum names isn't working. The following example below:
public enum SomeEnum {
@JsonProperty("num-one")
NUMONE,
@JsonProperty("num-two")
NUMTWO
}results in an OpenAPI file that looks like:
"enum": [
"NUMONE",
"NUMTWO"
]instead of the expected:
"enum": [
"num-one",
"num-two"
]The issue is in ModelResolver which is using the deprecated Jackson Databind method findEnumValue to read in the enum name. This method does not look for any overrides and just defaults to the name in the code. Using the replacement method findEnumValues fixes this problem.
Metadata
Metadata
Assignees
Labels
No labels