- 
                Notifications
    You must be signed in to change notification settings 
- Fork 111
Closed
Description
Task List
- [ X ] Steps to reproduce provided
- [ N/A] Stacktrace (if present) provided
- [ N/A] Example that reproduces the problem uploaded to Github
- [ X ] Full description of the issue provided (see below)
Steps to Reproduce
- Create Java Enum Class with JsonProperty
import com.fasterxml.jackson.annotation.JsonProperty;
public enum CurrencyPair2 {
    @JsonProperty("CAD-USD") CADUSD("CAD", "USD");
    private final String baseCurrency;
    private final String quoteCurrency;
    CurrencyPair2(String baseCurrency, String quoteCurrency) {
        this.baseCurrency = baseCurrency;
        this.quoteCurrency = quoteCurrency;
    }
    public String getBaseCurrency() {
        return baseCurrency;
    }
    public String getQuoteCurrency() {
        return quoteCurrency;
    }
}
- Reference class in response object/request params
- Build OpenApi:
annotationProcessor("io.micronaut.openapi:micronaut-openapi")
...
implementation("io.swagger.core.v3:swagger-annotations:2.1.6")
...
tasks.withType(JavaCompile) {
options.fork = true
options.forkOptions.jvmArgs << '-Dmicronaut.openapi.views.spec=rapidoc.enabled=true,swagger-ui.enabled=true,swagger-ui.theme=flattop'
}
- Check Swagger output
Expected Behaviour
Enum values should be CAD-USD and serialization should convert appropriately
CurrencyPair2:
      type: string
      enum:
      - CAD-USD
Actual Behaviour
Serialization converts on ingress and egress appropriately but enum values are CADUSD in the swagger schema
CurrencyPair2:
      type: string
      enum:
      - CADUSD
Tell us what happens instead
Environment Information
- Operating System: MavOS Mojave version 10.14.6
- Micronaut Version: 1.3.4
- JDK Version:
- OPENAPI_VERSION=2.0.10
Example Application
- TODO: link to github repository with example that reproduces the issue
Metadata
Metadata
Assignees
Labels
No labels