-
Notifications
You must be signed in to change notification settings - Fork 932
/
polymorphism.yaml
82 lines (82 loc) · 1.81 KB
/
polymorphism.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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
openapi: 3.0.0
info:
title: Polymorphism
description: 'Polymorphism example'
contact:
name: 'Swagger API Team'
version: '1'
servers:
-
url: 'https://example.localhost'
description: 'API server'
paths:
/test:
get:
tags:
- api
description: 'Get test'
operationId: 2bf08e1a95c02130edf82da5846bfca3
responses:
'200':
description: Polymorphism
content:
application/json:
schema:
$ref: '#/components/schemas/Request'
components:
schemas:
Responsible:
properties:
type:
type: string
enum:
- employee
- assignee
- fl
nullable: false
type: object
discriminator:
propertyName: type
mapping:
fl: '#/components/schemas/FlResponsible'
employee: '#/components/schemas/EmployeeResponsible'
oneOf:
-
$ref: '#/components/schemas/FlResponsible'
-
$ref: '#/components/schemas/EmployeeResponsible'
EmployeeResponsible:
type: object
allOf:
-
$ref: '#/components/schemas/Responsible'
-
properties:
property2:
type: string
nullable: false
type:
type: string
enum:
- Virtual
type: object
FlResponsible:
type: object
allOf:
-
$ref: '#/components/schemas/Responsible'
-
properties:
property3:
type: string
nullable: true
type: object
Request:
properties:
payload:
$ref: '#/components/schemas/Responsible'
type: object
tags:
-
name: api
description: 'API operations'