Skip to content

Commit ad0e66c

Browse files
authored
Add documentation for duplicate webapp route and error responses (#72)
* Add documentation for duplicate webapp route and add error responses * Modify documentation supported LINQ queries
1 parent a212b52 commit ad0e66c

File tree

1 file changed

+100
-5
lines changed

1 file changed

+100
-5
lines changed

webapp/niapp.yaml

Lines changed: 100 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ paths:
3333
$ref: '#/responses/Unauthorized'
3434
404:
3535
$ref: '#/responses/NotFound'
36+
default:
37+
$ref: '#/responses/Error'
3638
put:
3739
tags:
3840
- metadata
@@ -51,6 +53,8 @@ paths:
5153
$ref: '#/responses/Unauthorized'
5254
404:
5355
$ref: '#/responses/NotFound'
56+
default:
57+
$ref: '#/responses/Error'
5458
delete:
5559
tags:
5660
- metadata
@@ -66,6 +70,8 @@ paths:
6670
$ref: '#/responses/Unauthorized'
6771
404:
6872
$ref: '#/responses/NotFound'
73+
default:
74+
$ref: '#/responses/Error'
6975
'/webapps':
7076
get:
7177
tags:
@@ -112,6 +118,8 @@ paths:
112118
$ref: '#/responses/ValidationError'
113119
401:
114120
$ref: '#/responses/Unauthorized'
121+
default:
122+
$ref: '#/responses/Error'
115123
post:
116124
tags:
117125
- metadata
@@ -125,6 +133,8 @@ paths:
125133
$ref: '#/responses/CreateWebAppResponse'
126134
401:
127135
$ref: '#/responses/Unauthorized'
136+
default:
137+
$ref: '#/responses/Error'
128138
'/webapps/query':
129139
post:
130140
tags:
@@ -148,6 +158,8 @@ paths:
148158
$ref: '#/responses/ValidationError'
149159
401:
150160
$ref: '#/responses/Unauthorized'
161+
default:
162+
$ref: '#/responses/Error'
151163
'/webapps/{id}/sharing':
152164
put:
153165
tags:
@@ -167,6 +179,8 @@ paths:
167179
$ref: '#/responses/Unauthorized'
168180
404:
169181
$ref: '#/responses/NotFound'
182+
default:
183+
$ref: '#/responses/Error'
170184
'/webapps/shared-emails':
171185
get:
172186
tags:
@@ -179,6 +193,8 @@ paths:
179193
$ref: '#/responses/SharedEmailsResponse'
180194
401:
181195
$ref: '#/responses/Unauthorized'
196+
default:
197+
$ref: '#/responses/Error'
182198
'/webapps/{id}/content':
183199
get:
184200
tags:
@@ -195,6 +211,8 @@ paths:
195211
$ref: '#/responses/Unauthorized'
196212
404:
197213
$ref: '#/responses/NotFound'
214+
default:
215+
$ref: '#/responses/Error'
198216
put:
199217
tags:
200218
- content
@@ -218,6 +236,8 @@ paths:
218236
$ref: '#/responses/Unauthorized'
219237
404:
220238
$ref: '#/responses/NotFound'
239+
default:
240+
$ref: '#/responses/Error'
221241
'/webapps/{id}/content/{path}':
222242
get:
223243
tags:
@@ -235,7 +255,32 @@ paths:
235255
$ref: '#/responses/Unauthorized'
236256
404:
237257
$ref: '#/responses/NotFound'
258+
default:
259+
$ref: '#/responses/Error'
238260

261+
'/webapps/{sourceId}/duplicate':
262+
post:
263+
tags:
264+
- content
265+
summary: Duplicate webapp
266+
description: Duplicate a webapp by creating new webapp metadata with the specified name and duplicating existing content into the new webapp.
267+
operationId: duplicate-webapp
268+
parameters:
269+
- in: path
270+
type: string
271+
required: true
272+
name: sourceId
273+
description: The Id of the source webapp to copy content from
274+
- $ref: '#/parameters/DuplicateWebAppRequest'
275+
responses:
276+
200:
277+
$ref: '#/responses/CreateWebAppResponse'
278+
401:
279+
$ref: '#/responses/Unauthorized'
280+
404:
281+
$ref: '#/responses/NotFound'
282+
default:
283+
$ref: '#/responses/Error'
239284
'/webapps/{id}/duplicate/{sourceId}':
240285
post:
241286
tags:
@@ -249,14 +294,16 @@ paths:
249294
type: string
250295
required: true
251296
name: sourceId
252-
description: The Id of the source webapp to get copy content from
297+
description: The Id of the source webapp to copy content from
253298
responses:
254299
200:
255300
description: Success
256301
401:
257302
$ref: '#/responses/Unauthorized'
258303
404:
259304
$ref: '#/responses/NotFound'
305+
default:
306+
$ref: '#/responses/Error'
260307

261308
parameters:
262309
WebAppId:
@@ -339,8 +386,33 @@ parameters:
339386
items:
340387
type: string
341388
description: List of emails of users to share the webapp with. Applies when "shared" option is "direct"
389+
DuplicateWebAppRequest:
390+
in: body
391+
name: DuplicateWebAppRequest
392+
description: Duplicate WebApp Request
393+
schema:
394+
type: object
395+
title: Duplicate WebApp Request
396+
properties:
397+
name:
398+
type: string
399+
description: The name of the new webapp created during the duplication
400+
example: My webapp name
401+
workspace:
402+
type: string
403+
description: The workspace in which to create the new webapp. If no workspace is specified, the new webapp will be put in the default workspace.
404+
example: 0c80cf49-54e9-4e92-b117-3bfa574caa84
342405

343406
responses:
407+
Error:
408+
description: Error
409+
schema:
410+
description: Error response
411+
title: ErrorResponse
412+
type: object
413+
properties:
414+
error:
415+
$ref: '#/definitions/Error'
344416
Unauthorized:
345417
description: API Key is missing or invalid
346418
NotFound:
@@ -474,9 +546,9 @@ definitions:
474546
475547
- Logical OR operator 'or'. Example: 'x or y'
476548
477-
- Contains operator '.Contains()', used to check whether a string contains another string. Example: 'x.Contains(y)'
549+
- Starts with operator '.StartsWith()', used to check whether a string starts with another string. Example: 'x.StartsWith(y)'
478550
479-
- Does not contain operator '!.Contains()', used to check whether a string does not contain another string. Example: '!x.Contains(y)'
551+
- Does not start with operator '!.StartsWith()', used to check whether a string does not start with another string. Example: '!x.StartsWith(y)'
480552
481553
- String null or empty 'string.IsNullOrEmpty()', used to check whether a string is null or empty. Example: 'string.IsNullOrEmpty(x)'
482554
@@ -489,15 +561,15 @@ definitions:
489561
490562
- name
491563
492-
- properties
564+
- properties.embedLocation
493565
494566
- shared
495567
496568
- type
497569
498570
- workspace
499571
type: string
500-
example: name.Contains("myWebApp") || type == "WebVI"
572+
example: name.StartsWith("myWebApp") || type == "WebVI"
501573
take:
502574
description: The maximum number of webapps to return
503575
type: integer
@@ -509,3 +581,26 @@ definitions:
509581
description: The continuation token can be used to paginate through the webapp query results. Provide this token in the next query webapps call.
510582
type: string
511583
example: token
584+
Error:
585+
description: Contains error information
586+
type: object
587+
properties:
588+
name:
589+
description: String error code
590+
type: string
591+
code:
592+
description: Numeric error code
593+
type: integer
594+
message:
595+
description: Complete error message
596+
type: string
597+
args:
598+
description: Positional argument values for the error code
599+
type: array
600+
items:
601+
type: string
602+
example:
603+
name: DocumentManager.NotFound
604+
code: -252520
605+
message: The specified document was not found.
606+
args: []

0 commit comments

Comments
 (0)