1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
|
openapi: "3.0.0"
components:
schemas:
ObjectBase:
description: Object schema
type: object
properties:
name:
description: Name of the object
type: string
type:
description: Object type
type: string
enum:
- my_first_object
- my_second_object
- my_third_object
CreateObjectRequest:
description: Request schema for object creation
type: object
allOf:
- $ref: '#/components/schemas/ObjectBase'
required:
- name
- type
UpdateObjectRequest:
description: Request schema for object updates
type: object
allOf:
- $ref: '#/components/schemas/ObjectBase'
Demo:
oneOf:
- $ref: "#/components/schemas/ObjectBase"
- $ref: "#/components/schemas/CreateObjectRequest"
- $ref: "#/components/schemas/UpdateObjectRequest"
discriminator:
propertyName: type
|