Skip to content

Appending to referenced enum #2943

Closed Answered by webron
sulfax asked this question in Q&A
Discussion options

You must be logged in to vote

This is more of a JSON Schema request than an OpenAPI one. You can achieve what you're looking for using oneOf or anyOf depending on the content of the different enums.

  schema:
    oneOf:
      - $ref: "#/shared/components/schemas/SensorType.yaml"
      - enum: [ Temp, Vibration, SignalLoss ]
    description: Sensor to trigger alarm

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by sulfax
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants
Converted from issue

This discussion was converted from issue #2941 on June 13, 2022 14:35.