system
April 12, 2021, 4:03pm
1
Originally posted by UncleMoose on April 12, 2021
A common practice is to use enum to define coded persistence values such as:
Status:
type: string
enum:
name: ABANDONED
value: A
name: ISSUED
value: I
However this generates a JSON object as the value
ABANDONED_A(“{name: ABANDONED, value: A}”)
Is this not possible with OAS3?
system
April 12, 2021, 4:41pm
2
Originally posted by HKosova on April 12, 2021
Is this not possible with OAS3?
OpenAPI 3.0 does not have a way to annotate individual enum values, but this is possible in OpenAPI 3.1 using oneOf + const (once tooling support is available):
Status:
oneOf:
- title: ABANDONED
const: A
- title: ISSUED
const: I
system
August 4, 2021, 2:27pm
3
Originally posted by gtludwig on August 04, 2021
I am trying to implement this as well in my open API specification, but IntelliJ is marking “const” as a prohibited property.
system
August 5, 2021, 1:01am
4
Originally posted by nmrao on August 04, 2021
That could be intellij’s limitation.