Skip to content

Commit 3225e89

Browse files
openapi: Fix Compile API Accept headers, Part II (#161)
openapi: Rework Accept header spec style. This commit reworks how we specify the Accept header options. Previously, we specified them as a required request parameter, which was syntactically legal, but was ignored by some tools. This time around, we've mapped out each Accept header uniformly under "requestBody > content > $header" to ensure they are picked up consistently by most tools. Signed-off-by: Philip Conrad <philip@chariot-chaser.net>
1 parent b66c760 commit 3225e89

File tree

1 file changed

+99
-19
lines changed

1 file changed

+99
-19
lines changed

openapi/openapi.yaml

Lines changed: 99 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,6 @@ paths:
127127
post:
128128
parameters:
129129
- $ref: "#/components/parameters/policyPath"
130-
- $ref: "#/components/parameters/CompileAcceptTypes"
131130
- $ref: "#/components/parameters/GzipAcceptEncoding"
132131
- $ref: "#/components/parameters/GzipContentEncoding"
133132
- $ref: "#/components/parameters/pretty"
@@ -153,6 +152,105 @@ paths:
153152
input:
154153
$ref: "#/components/schemas/input"
155154
description: The input document to use during partial evaluation.
155+
application/vnd.styra.multitarget+json:
156+
schema:
157+
type: object
158+
properties:
159+
options:
160+
$ref: "#/components/schemas/CompileOptions"
161+
unknowns:
162+
$ref: "#/components/schemas/CompileUnknowns"
163+
input:
164+
$ref: "#/components/schemas/input"
165+
description: The input document to use during partial evaluation.
166+
application/vnd.styra.ucast.all+json:
167+
schema:
168+
type: object
169+
properties:
170+
options:
171+
$ref: "#/components/schemas/CompileOptions"
172+
unknowns:
173+
$ref: "#/components/schemas/CompileUnknowns"
174+
input:
175+
$ref: "#/components/schemas/input"
176+
description: The input document to use during partial evaluation.
177+
application/vnd.styra.ucast.minimal+json:
178+
schema:
179+
type: object
180+
properties:
181+
options:
182+
$ref: "#/components/schemas/CompileOptions"
183+
unknowns:
184+
$ref: "#/components/schemas/CompileUnknowns"
185+
input:
186+
$ref: "#/components/schemas/input"
187+
description: The input document to use during partial evaluation.
188+
application/vnd.styra.ucast.linq+json:
189+
schema:
190+
type: object
191+
properties:
192+
options:
193+
$ref: "#/components/schemas/CompileOptions"
194+
unknowns:
195+
$ref: "#/components/schemas/CompileUnknowns"
196+
input:
197+
$ref: "#/components/schemas/input"
198+
description: The input document to use during partial evaluation.
199+
application/vnd.styra.ucast.prisma+json:
200+
schema:
201+
type: object
202+
properties:
203+
options:
204+
$ref: "#/components/schemas/CompileOptions"
205+
unknowns:
206+
$ref: "#/components/schemas/CompileUnknowns"
207+
input:
208+
$ref: "#/components/schemas/input"
209+
description: The input document to use during partial evaluation.
210+
application/vnd.styra.sql.sqlserver+json:
211+
schema:
212+
type: object
213+
properties:
214+
options:
215+
$ref: "#/components/schemas/CompileOptions"
216+
unknowns:
217+
$ref: "#/components/schemas/CompileUnknowns"
218+
input:
219+
$ref: "#/components/schemas/input"
220+
description: The input document to use during partial evaluation.
221+
application/vnd.styra.sql.mysql+json:
222+
schema:
223+
type: object
224+
properties:
225+
options:
226+
$ref: "#/components/schemas/CompileOptions"
227+
unknowns:
228+
$ref: "#/components/schemas/CompileUnknowns"
229+
input:
230+
$ref: "#/components/schemas/input"
231+
description: The input document to use during partial evaluation.
232+
application/vnd.styra.sql.postgresql+json:
233+
schema:
234+
type: object
235+
properties:
236+
options:
237+
$ref: "#/components/schemas/CompileOptions"
238+
unknowns:
239+
$ref: "#/components/schemas/CompileUnknowns"
240+
input:
241+
$ref: "#/components/schemas/input"
242+
description: The input document to use during partial evaluation.
243+
application/vnd.styra.sql.sqlite+json:
244+
schema:
245+
type: object
246+
properties:
247+
options:
248+
$ref: "#/components/schemas/CompileOptions"
249+
unknowns:
250+
$ref: "#/components/schemas/CompileUnknowns"
251+
input:
252+
$ref: "#/components/schemas/input"
253+
description: The input document to use during partial evaluation.
156254
responses:
157255
"200":
158256
description: Successful response
@@ -241,24 +339,6 @@ components:
241339
schema:
242340
type: string
243341
enum: [gzip]
244-
CompileAcceptTypes:
245-
name: Accept
246-
description: "Indicates the server should generate the target format of data filters."
247-
in: header
248-
required: true
249-
schema:
250-
type: string
251-
enum:
252-
- application/json
253-
- application/vnd.styra.multitarget+json
254-
- application/vnd.styra.ucast.all+json
255-
- application/vnd.styra.ucast.minimal+json
256-
- application/vnd.styra.ucast.linq+json
257-
- application/vnd.styra.ucast.prisma+json
258-
- application/vnd.styra.sql.sqlserver+json
259-
- application/vnd.styra.sql.mysql+json
260-
- application/vnd.styra.sql.postgresql+json
261-
- application/vnd.styra.sql.sqlite+json
262342
pretty:
263343
name: pretty
264344
description: If parameter is `true`, response will formatted for humans.

0 commit comments

Comments
 (0)