Have event schema objects serializable
[cps.git] / cps-rest / docs / openapi / components.yml
1 # ============LICENSE_START=======================================================
2 # Copyright (c) 2021 Bell Canada.
3 # ================================================================================
4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at
7 #
8 #       http://www.apache.org/licenses/LICENSE-2.0
9 #
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
15 # ============LICENSE_END=========================================================
16
17 components:
18   schemas:
19
20     AnchorDetails:
21       type: object
22       title: Anchor details by anchor Name
23       properties:
24         name:
25           type: string
26           example: my_anchor
27         dataspaceName:
28           type: string
29           example: my_dataspace
30         schemaSetName:
31           type: string
32           example: my_schema_set
33
34     ErrorMessage:
35       type: object
36       title: Error
37       properties:
38         status:
39           type: string
40           example: 400
41         message:
42           type: string
43           example: Dataspace not found
44         details:
45           type: string
46           example: Dataspace with name D1 does not exist.
47
48     MultipartFile:
49       required:
50         - file
51       properties:
52         multipartFile:
53           type: string
54           description: multipartFile
55           format: binary
56           example: http://example.com/examples/example.yang
57
58     ModuleReferences:
59       type: object
60       title: Module reference object
61       properties:
62         name:
63           type: string
64           example: module_reference_name
65         namespace:
66           type: string
67           example: module_reference_namespace
68         revision:
69           type: string
70           example: module_reference_revision
71
72     SchemaSetDetails:
73       type: object
74       title: Schema set details by dataspace and schemasetName
75       properties:
76         dataspaceName:
77           type: string
78           example: my_dataspace
79         moduleReferences:
80           type: array
81           items:
82             $ref: '#/components/schemas/ModuleReferences'
83         name:
84           type: string
85           example: my_schema_set
86
87   parameters:
88     dataspaceNameInQuery:
89       name: dataspace-name
90       in: query
91       description: dataspace-name
92       required: true
93       schema:
94         type: string
95     dataspaceNameInPath:
96       name: dataspace-name
97       in: path
98       description: dataspace-name
99       required: true
100       schema:
101         type: string
102     anchorNameInPath:
103       name: anchor-name
104       in: path
105       description: anchor-name
106       required: true
107       schema:
108         type: string
109     schemaSetNameInQuery:
110       name: schema-set-name
111       in: query
112       description: schema-set-name
113       required: true
114       schema:
115         type: string
116     schemaSetNameInPath:
117       name: schema-set-name
118       in: path
119       description: schema-set-name
120       required: true
121       schema:
122         type: string
123     anchorNameInQuery:
124       name: anchor-name
125       in: query
126       description: anchor-name
127       required: true
128       schema:
129         type: string
130     xpathInQuery:
131       name: xpath
132       in: query
133       description: xpath
134       required: false
135       schema:
136         type: string
137         default: /
138     requiredXpathInQuery:
139       name: xpath
140       in: query
141       description: xpath
142       required: true
143       schema:
144         type: string
145     cpsPathInQuery:
146       name: cps-path
147       in: query
148       description: cps-path
149       required: false
150       schema:
151         type: string
152         default: /
153     includeDescendantsOptionInQuery:
154       name: include-descendants
155       in: query
156       description: include-descendants
157       required: false
158       schema:
159         type: boolean
160         default: false
161
162   responses:
163     NotFound:
164       description: The specified resource was not found
165       content:
166         application/json:
167           schema:
168             $ref: '#/components/schemas/ErrorMessage'
169     Unauthorized:
170       description: Unauthorized
171       content:
172         application/json:
173           schema:
174             $ref: '#/components/schemas/ErrorMessage'
175     Forbidden:
176       description: Forbidden
177       content:
178         application/json:
179           schema:
180             $ref: '#/components/schemas/ErrorMessage'
181     BadRequest:
182       description: Bad Request
183       content:
184         application/json:
185           schema:
186             $ref: '#/components/schemas/ErrorMessage'
187     Conflict:
188       description: Conflict
189       content:
190         application/json:
191           schema:
192             $ref: '#/components/schemas/ErrorMessage'
193     Ok:
194       description: OK
195       content:
196         application/json:
197           schema:
198             type: object
199     Created:
200       description: Created
201       content:
202         text/plain:
203           schema:
204             type: string
205     NoContent:
206       description: No Content
207       content: {}