forked from OAI/sig-moonwalk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
parameterSchema.yaml
72 lines (72 loc) · 2.42 KB
/
parameterSchema.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
openapi: 4.0.0
info:
title: Parameters defined at the path and at the request level
version: 0.5.0
paths:
'speakers/{speakerId}{?format}': ## as format is optional, it does not need to be declared for each request, only the ones that use it
parameterSchema:
type: object
properties:
speakerId:
type: string
title: Speaker ID
requests:
getSpeakerAsJson: ## the requests getSpeakerAsJson and getSpeakerAsCSV could be declared as a single request but with two 200 responses.
parameterSchema:
type: object
properties:
format:
type: string
const: json ## This example shows how you use query parameters to distinction between requests.
method: get
responses:
ok:
status: 200
contentType: application/json
contentSchema:
$ref: '#/components/schemas/speaker'
getSpeakerAsCSV:
parameterSchema:
type: object
properties:
format:
type: string
const: csv
method: get
responses:
ok:
status: 200
contentType: text/csv
contentSchema:
type: string
updateSpeaker:
method: put
contentType: application/json
contentSchema:
$ref: '#/components/schemas/speaker'
responses:
ok:
status: 200
contentType: application/json
contentSchema:
$ref: '#/components/schemas/speaker'
deleteSpeaker:
method: delete
responses:
ok:
status: 200
responses:
notFound:
status: 404
contentType: application/http-problem
responses:
serverError:
status: 5XX
contentType: application/http-problem
components:
schemas:
Speaker:
type: object
properties:
name:
type: string