fork of hey-api/openapi-ts because I need some additional things
1openapi: 3.1.1
2info:
3 title: OpenAPI 3.1.1 transforms read write example
4 version: 1
5paths:
6 /foo-read-write:
7 post:
8 requestBody:
9 content:
10 'application/json':
11 schema:
12 $ref: '#/components/schemas/FooReadWrite'
13 required: true
14 responses:
15 '200':
16 content:
17 '*/*':
18 schema:
19 $ref: '#/components/schemas/FooReadWrite'
20 description: OK
21 /foo-read:
22 post:
23 requestBody:
24 content:
25 'application/json':
26 schema:
27 $ref: '#/components/schemas/FooRead'
28 required: true
29 responses:
30 '200':
31 content:
32 '*/*':
33 schema:
34 $ref: '#/components/schemas/FooRead'
35 description: OK
36 /foo-write:
37 post:
38 requestBody:
39 content:
40 'application/json':
41 schema:
42 $ref: '#/components/schemas/FooWrite'
43 required: true
44 responses:
45 '200':
46 content:
47 '*/*':
48 schema:
49 $ref: '#/components/schemas/FooWrite'
50 description: OK
51 put:
52 parameters:
53 - $ref: '#/components/parameters/Foo'
54 requestBody:
55 $ref: '#/components/requestBodies/Foo'
56 responses:
57 '200':
58 $ref: '#/components/responses/Foo'
59components:
60 parameters:
61 Foo:
62 name: foo
63 in: query
64 description: Query parameter
65 required: false
66 schema:
67 type: string
68 requestBodies:
69 Foo:
70 required: true
71 description: PUT /foo-write payload
72 content:
73 'application/json':
74 schema:
75 type: object
76 properties:
77 foo:
78 $ref: '#/components/schemas/BarRead'
79 responses:
80 Foo:
81 content:
82 '*/*':
83 schema:
84 $ref: '#/components/schemas/FooWrite'
85 description: OK
86 schemas:
87 FooReadWrite:
88 allOf:
89 - $ref: '#/components/schemas/BarRead'
90 - type: object
91 properties:
92 foo:
93 writeOnly: true
94 type: string
95 FooRead:
96 allOf:
97 - $ref: '#/components/schemas/BarRead'
98 - type: object
99 properties:
100 foo:
101 readOnly: true
102 type: string
103 FooWrite:
104 allOf:
105 - $ref: '#/components/schemas/BarWrite'
106 - type: object
107 properties:
108 foo:
109 writeOnly: true
110 type: string
111 BarRead:
112 anyOf:
113 - $ref: '#/components/schemas/Baz'
114 - $ref: '#/components/schemas/QuxAllWrite'
115 - $ref: '#/components/schemas/QuxAllRead'
116 - type: object
117 properties:
118 bar:
119 readOnly: true
120 type: string
121 BarWrite:
122 anyOf:
123 - $ref: '#/components/schemas/Baz'
124 - $ref: '#/components/schemas/QuxAllWrite'
125 - $ref: '#/components/schemas/QuxAllRead'
126 - type: object
127 properties:
128 bar:
129 writeOnly: true
130 type: string
131 Baz:
132 type: object
133 properties:
134 baz:
135 type: string
136 QuxAllWrite:
137 type: object
138 properties:
139 baz:
140 writeOnly: true
141 type: string
142 QuxAllRead:
143 type: object
144 properties:
145 baz:
146 readOnly: true
147 type: string
148 Quux:
149 type: object
150 properties:
151 baz:
152 type: array
153 items:
154 $ref: '#/components/schemas/Baz'
155 qux:
156 $ref: '#/components/schemas/QuxAllRead'
157 Corge:
158 type: object
159 properties:
160 foo:
161 type: object
162 properties:
163 baz:
164 type: boolean
165 writeOnly: true
166 bar:
167 type: object
168 properties:
169 baz:
170 type: boolean
171 readOnly: true
172 FooReadWriteRef:
173 type: object
174 properties:
175 foo:
176 $ref: '#/components/schemas/FooReadWrite'
177 bar:
178 $ref: '#/components/schemas/FooReadWriteRef'
179 FooReadWriteRef2:
180 $ref: '#/components/schemas/FooReadWrite'