-
Would love to be able to append to an existing enum. Not all values are applickable in all cases, this means that i need to redefine the enum. Especially when used together with deepmap's oapi-gen this would be nice. Example: type: string
enum: [Motion, Push, Voice] Doorbell.yaml: schema:
$ref: "#/shared/components/schemas/SensorType.yaml"
description: Sensor to trigger doorbell Alarm.yaml: schema:
$ref: "#/shared/components/schemas/SensorType.yaml"
append: [ Temp, Vibration, SignalLoss ]
description: Sensor to trigger alarm |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
This is more of a JSON Schema request than an OpenAPI one. You can achieve what you're looking for using schema:
oneOf:
- $ref: "#/shared/components/schemas/SensorType.yaml"
- enum: [ Temp, Vibration, SignalLoss ]
description: Sensor to trigger alarm |
Beta Was this translation helpful? Give feedback.
-
Answered and accepted, closing. |
Beta Was this translation helpful? Give feedback.
This is more of a JSON Schema request than an OpenAPI one. You can achieve what you're looking for using
oneOf
oranyOf
depending on the content of the different enums.