Skip to content

Instantly share code, notes, and snippets.

@wing328
Created November 11, 2022 07:06
Show Gist options
  • Save wing328/f67cb234cc36b8dd3f37c7bf3057de70 to your computer and use it in GitHub Desktop.
Save wing328/f67cb234cc36b8dd3f37c7bf3057de70 to your computer and use it in GitHub Desktop.
components:
schemas:
Pet:
type: object
required:
- pet_type
properties:
pet_type:
type: string
Dog:
allOf:
- $ref: '#/components/schemas/Pet'
- type: object
properties:
bark:
type: boolean
breed:
type: string
enum: [Dingo, Husky, Retriever, Shepherd]
Cat:
allOf:
- $ref: '#/components/schemas/Pet'
- type: object
properties:
hunts:
type: boolean
age:
type: integer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment