-
Notifications
You must be signed in to change notification settings - Fork 0
/
spec.yaml
61 lines (60 loc) · 1.32 KB
/
spec.yaml
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
openapi: "3.0.3"
info:
title: MS Pet API
version: 1.0.0
description: De API for testing the discriminator in openapi 6
paths:
/api/projects:
get:
summary: get a pet
operationId: getPets
tags:
- pets
responses:
200:
description: Succes respons
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/PetResponse'
components:
schemas:
PetResponse:
oneOf:
- $ref: '#/components/schemas/Cat'
- $ref: '#/components/schemas/Dog'
- $ref: '#/components/schemas/Lizard'
discriminator:
propertyName: petType
Cat:
type: object
# all other properties specific to a `Cat`
required:
- petType
properties:
catName:
type: string
petType:
type: string
Dog:
type: object
# all other properties specific to a `Dog`
required:
- petType
properties:
bark:
type: string
petType:
type: string
Lizard:
type: object
# all other properties specific to a `Lizard`
required:
- petType
properties:
lovesRocks:
type: boolean
petType:
type: string