OpenLiberty / open-liberty

Open Liberty is a highly composable, fast to start, dynamic application server runtime environment
https://openliberty.io
Eclipse Public License 2.0
1.16k stars 599 forks source link

Openapi definition of the ChronoUnit enum shows lowercase literals #12679

Open srnjak opened 4 years ago

srnjak commented 4 years ago

In jax-rs representation object I used property of type java.time.temporal.ChronoUnit, which is an enum.

Example:

public class MyRepresentation {
    private ChronoUnit chrono;
}

In generated openapi document I get literals in lower case:

MyRepresentation:
      type: object
      properties:
        chrono:
          type: string
          enum:
          - Nanos
          - Micros
          - Millis
          - Seconds
          - Minutes
          - Hours
          - HalfDays
          - Days
          - Weeks
          - Months
          - Years
          - Decades
          - Centuries
          - Millennia
          - Eras
          - Forever

I would expect openapi to be with upper-case literals like this:

MyRepresentation:
      type: object
      properties:
        chrono:
          type: string
          enum:
          - NANOS
          - MICROS
          - MILLIS
          - SECONDS
          - MINUTES
          - HOURS
          - HALF_DAYS
          - DAYS
          - WEEKS
          - MONTHS
          - YEARS
          - DECADES
          - CENTURIES
          - MILLENIA
          - ERAS
          - FOREVER
Azquelt commented 2 years ago

The issue with the casing of enum constants is fixed in the mpOpenapi-2.0 feature (and newer versions). However, the specific scenario in this defect is still broken in mpOpenapi-2.0 due to #17069 which means the enum constants are not included at all for ChronoUnit.