3d2eb57e4d1905bd1b1e9731ee355f792dc15760
[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 #
16 # SPDX-License-Identifier: Apache-2.0
17 # ============LICENSE_END=========================================================
18
19 components:
20   schemas:
21
22     AnchorDetails:
23       type: object
24       title: Anchor details by anchor Name
25       properties:
26         name:
27           type: string
28           example: my_anchor
29         dataspaceName:
30           type: string
31           example: my_dataspace
32         schemaSetName:
33           type: string
34           example: my_schema_set
35
36     ErrorMessage:
37       type: object
38       title: Error
39       properties:
40         status:
41           type: string
42           example: 400
43         message:
44           type: string
45           example: Dataspace not found
46         details:
47           type: string
48           example: Dataspace with name D1 does not exist.
49
50     MultipartFile:
51       type: object
52       required:
53         - file
54       properties:
55         file:
56           type: string
57           description: multipartFile
58           format: binary
59           example: http://example.com/examples/example.yang
60
61     ModuleReferences:
62       type: object
63       title: Module reference object
64       properties:
65         name:
66           type: string
67           example: module_reference_name
68         namespace:
69           type: string
70           example: module_reference_namespace
71         revision:
72           type: string
73           example: module_reference_revision
74
75     SchemaSetDetails:
76       type: object
77       title: Schema set details by dataspace and schemasetName
78       properties:
79         dataspaceName:
80           type: string
81           example: my_dataspace
82         moduleReferences:
83           type: array
84           items:
85             $ref: '#/components/schemas/ModuleReferences'
86         name:
87           type: string
88           example: my_schema_set
89
90   parameters:
91     dataspaceNameInQuery:
92       name: dataspace-name
93       in: query
94       description: dataspace-name
95       required: true
96       schema:
97         type: string
98     dataspaceNameInPath:
99       name: dataspace-name
100       in: path
101       description: dataspace-name
102       required: true
103       schema:
104         type: string
105     anchorNameInPath:
106       name: anchor-name
107       in: path
108       description: anchor-name
109       required: true
110       schema:
111         type: string
112     schemaSetNameInQuery:
113       name: schema-set-name
114       in: query
115       description: schema-set-name
116       required: true
117       schema:
118         type: string
119     schemaSetNameInPath:
120       name: schema-set-name
121       in: path
122       description: schema-set-name
123       required: true
124       schema:
125         type: string
126     anchorNameInQuery:
127       name: anchor-name
128       in: query
129       description: anchor-name
130       required: true
131       schema:
132         type: string
133     xpathInQuery:
134       name: xpath
135       in: query
136       description: xpath
137       required: false
138       schema:
139         type: string
140         default: /
141     requiredXpathInQuery:
142       name: xpath
143       in: query
144       description: xpath
145       required: true
146       schema:
147         type: string
148     cpsPathInQuery:
149       name: cps-path
150       in: query
151       description: cps-path
152       required: false
153       schema:
154         type: string
155         default: /
156     includeDescendantsOptionInQuery:
157       name: include-descendants
158       in: query
159       description: include-descendants
160       required: false
161       schema:
162         type: boolean
163         default: false
164     observedTimestampInQuery:
165       name: observed-timestamp
166       in: query
167       description: observed-timestamp
168       required: false
169       schema:
170         type: string
171         example: '2021-03-21T00:10:34.030-0100'
172
173   responses:
174     NotFound:
175       description: The specified resource was not found
176       content:
177         application/json:
178           schema:
179             $ref: '#/components/schemas/ErrorMessage'
180     Unauthorized:
181       description: Unauthorized
182       content:
183         application/json:
184           schema:
185             $ref: '#/components/schemas/ErrorMessage'
186     Forbidden:
187       description: Forbidden
188       content:
189         application/json:
190           schema:
191             $ref: '#/components/schemas/ErrorMessage'
192     BadRequest:
193       description: Bad Request
194       content:
195         application/json:
196           schema:
197             $ref: '#/components/schemas/ErrorMessage'
198     Conflict:
199       description: Conflict
200       content:
201         application/json:
202           schema:
203             $ref: '#/components/schemas/ErrorMessage'
204     Ok:
205       description: OK
206       content:
207         application/json:
208           schema:
209             type: object
210           example: { "key": "value" }
211     Created:
212       description: Created
213       content:
214         text/plain:
215           schema:
216             type: string
217     NoContent:
218       description: No Content
219       content: {}