ae0326d7eaaf85e952fee2e435479cb45f786f66
[cps.git] / cps-rest / docs / openapi / components.yml
1 # ============LICENSE_START=======================================================
2 # Copyright (c) 2021-2022 Bell Canada.
3 # Modifications Copyright (C) 2021-2022 Nordix Foundation
4 # ================================================================================
5 # Licensed under the Apache License, Version 2.0 (the "License");
6 # you may not use this file except in compliance with the License.
7 # You may obtain a copy of the License at
8 #
9 #       http://www.apache.org/licenses/LICENSE-2.0
10 #
11 # Unless required by applicable law or agreed to in writing, software
12 # distributed under the License is distributed on an "AS IS" BASIS,
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 # See the License for the specific language governing permissions and
15 # limitations under the License.
16 #
17 # SPDX-License-Identifier: Apache-2.0
18 # ============LICENSE_END=========================================================
19
20 components:
21   schemas:
22
23     AnchorDetails:
24       type: object
25       title: Anchor details by anchor Name
26       properties:
27         name:
28           type: string
29           example: my-anchor
30         dataspaceName:
31           type: string
32           example: my-dataspace
33         schemaSetName:
34           type: string
35           example: my-schema-set
36
37     ErrorMessage:
38       type: object
39       title: Error
40       properties:
41         status:
42           type: string
43         message:
44           type: string
45         details:
46           type: string
47
48     MultipartFile:
49       type: object
50       required:
51         - file
52       properties:
53         file:
54           type: string
55           description: multipartFile
56           format: binary
57           example:  'https://github.com/onap/cps/blob/master/cps-service/src/test/resources/bookstore.yang'
58
59     ModuleReferences:
60       type: object
61       title: Module reference object
62       properties:
63         name:
64           type: string
65           example: my-module-reference-name
66         namespace:
67           type: string
68           example: my-module-reference-namespace
69         revision:
70           type: string
71           example: my-module-reference-revision
72
73     SchemaSetDetails:
74       type: object
75       title: Schema set details by dataspace and schemasetName
76       properties:
77         dataspaceName:
78           type: string
79           example: my-dataspace
80         moduleReferences:
81           type: array
82           items:
83             $ref: '#/components/schemas/ModuleReferences'
84         name:
85           type: string
86           example: my-schema-set
87
88   examples:
89     dataSample:
90       value:
91         test:bookstore:
92           bookstore-name: Chapters
93           categories:
94             - code: 01
95               name: SciFi
96             - code: 02
97               name: kids
98
99   parameters:
100     dataspaceNameInQuery:
101       name: dataspace-name
102       in: query
103       description: dataspace-name
104       required: true
105       schema:
106         type: string
107         example: my-dataspace
108     dataspaceNameInPath:
109       name: dataspace-name
110       in: path
111       description: dataspace-name
112       required: true
113       schema:
114         type: string
115         example: my-dataspace
116     anchorNameInPath:
117       name: anchor-name
118       in: path
119       description: anchor-name
120       required: true
121       schema:
122         type: string
123         example: my-anchor
124     schemaSetNameInQuery:
125       name: schema-set-name
126       in: query
127       description: schema-set-name
128       required: true
129       schema:
130         type: string
131         example: my-schema-set
132     schemaSetNameInPath:
133       name: schema-set-name
134       in: path
135       description: schema-set-name
136       required: true
137       schema:
138         type: string
139         example: my-schema-set
140     anchorNameInQuery:
141       name: anchor-name
142       in: query
143       description: anchor-name
144       required: true
145       schema:
146         type: string
147         example: my-anchor
148     xpathInQuery:
149       name: xpath
150       in: query
151       description: For more details on xpath, please refer https://docs.onap.org/projects/onap-cps/en/latest/cps-path.html
152       required: false
153       schema:
154         type: string
155         default: /
156       examples:
157         container xpath:
158           value: /shops/bookstore
159         list attributes xpath:
160           value: /shops/bookstore/categories[@code=1]
161     requiredXpathInQuery:
162       name: xpath
163       in: query
164       description: For more details on xpath, please refer https://docs.onap.org/projects/onap-cps/en/latest/cps-path.html
165       required: true
166       schema:
167         type: string
168       examples:
169         container xpath:
170           value: /shops/bookstore
171         list attributes xpath:
172           value: /shops/bookstore/categories[@code=1]
173     cpsPathInQuery:
174       name: cps-path
175       in: query
176       description: For more details on cps path, please refer https://docs.onap.org/projects/onap-cps/en/latest/cps-path.html
177       required: false
178       schema:
179         type: string
180         default: /
181       examples:
182         container cps path:
183           value: //bookstore
184         list attributes cps path:
185           value: //categories[@code=1]
186     includeDescendantsOptionInQuery:
187       name: include-descendants
188       in: query
189       description: include-descendants
190       required: false
191       schema:
192         type: boolean
193         default: false
194         example: false
195     observedTimestampInQuery:
196       name: observed-timestamp
197       in: query
198       description: observed-timestamp
199       required: false
200       schema:
201         type: string
202         example: '2021-03-21T00:10:34.030-0100'
203
204   responses:
205     NotFound:
206       description: The specified resource was not found
207       content:
208         application/json:
209           schema:
210             $ref: '#/components/schemas/ErrorMessage'
211           example:
212             status: 404
213             message: Resource Not Found
214             details: The requested resource is not found
215     Unauthorized:
216       description: Unauthorized
217       content:
218         application/json:
219           schema:
220             $ref: '#/components/schemas/ErrorMessage'
221           example:
222             status: 401
223             message: Unauthorized request
224             details: This request is unauthorized
225     Forbidden:
226       description: Forbidden
227       content:
228         application/json:
229           schema:
230             $ref: '#/components/schemas/ErrorMessage'
231           example:
232             status: 403
233             message: Request Forbidden
234             details: This request is forbidden
235     BadRequest:
236       description: Bad Request
237       content:
238         application/json:
239           schema:
240             $ref: '#/components/schemas/ErrorMessage'
241           example:
242             status: 400
243             message: Bad Request
244             details: The provided request is not valid
245     Conflict:
246       description: Conflict
247       content:
248         application/json:
249           schema:
250             $ref: '#/components/schemas/ErrorMessage'
251           example:
252             status: 409
253             message: Conflicting request
254             details: The request cannot be processed as the resource is in use.
255     Ok:
256       description: OK
257       content:
258         application/json:
259           schema:
260             type: object
261           examples:
262             dataSample:
263               value: ""
264     Created:
265       description: Created
266       content:
267         text/plain:
268           schema:
269             type: string
270             example: my-resource
271     InternalServerError:
272       description: Internal Server Error
273       content:
274         application/json:
275           schema:
276             $ref: "#/components/schemas/ErrorMessage"
277           example:
278             status: 500
279             message: Internal Server Error
280             details: Internal Server Error occurred
281     NoContent:
282       description: No Content
283       content: {}