Skip to content

Instantly share code, notes, and snippets.

@milovtim
Created December 15, 2023 10:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save milovtim/f190c045fc356e06403670c488cdd76a to your computer and use it in GitHub Desktop.
Save milovtim/f190c045fc356e06403670c488cdd76a to your computer and use it in GitHub Desktop.
OpenAPI tweaks

Enums

Standart enums

PetTypes:
  type: string
  description: What animal might be a pet
  enum:
    - cat
    - dog
    - tourtile

Enumerated constants with title/descriptions and with NO EXTENSIONS

Severity:
  type: integer
  oneOf:
    - title: HIGH
      const: 2
      description: An urgent problem
    - title: MEDIUM
      const: 1
    - title: LOW
      const: 0
      description: Can wait forever
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment