Skip to content

Commit

Permalink
OpenAPI specifications for get source
Browse files Browse the repository at this point in the history
  • Loading branch information
rubhanazeem committed Sep 30, 2022
1 parent 6888f1e commit be1d559
Show file tree
Hide file tree
Showing 3 changed files with 68 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/api/public/apidocs-new/OBS-v2.10.50.yaml
Expand Up @@ -255,7 +255,8 @@ paths:
$ref: 'paths/source_orderkiwirepos.yaml'

# Sources - Projects

/source:
$ref: 'paths/source.yaml'
/source/{project_name}?cmd=addchannels:
$ref: 'paths/source_project_name_cmd_addchannels.yaml'
/source/{project_name}?cmd=copy:
Expand Down
13 changes: 13 additions & 0 deletions src/api/public/apidocs-new/components/schemas/source/projects.yaml
@@ -0,0 +1,13 @@
type: array
items:
type: object
properties:
entry:
type: object
properties:
name:
type: string
xml:
attribute: true
xml:
name: directory
53 changes: 53 additions & 0 deletions src/api/public/apidocs-new/paths/source.yaml
@@ -0,0 +1,53 @@
get:
summary: List all the projects
description: |
Get a list of projects
parameters:
- name: deleted
in: query
schema:
type: integer
description: Set to 1 to include deleted projects in the listing. This is available for Admins only.
example: 0
required: false

responses:
'200':
description: OK. The request has succeeded.
content:
application/xml; charset=utf-8:
schema:
$ref: '../components/schemas/source/projects.yaml'
examples:
existing_projects:
entry:
name: "home:Admin"
deleted_projects:
entry:
name: "home:Admin"

'400':
description: Wrong value for deleted parameter.
content:
application/xml; charset=utf-8:
schema:
$ref: '../components/schemas/api_response.yaml'
examples:
not boolean:
value:
code: 400
summary: "not boolean"
'401':
$ref: '../components/responses/unauthorized.yaml'
'403':
description: |
No permission to access deleted projects.
content:
application/xml; charset=utf-8:
schema:
$ref: '../components/schemas/api_response.yaml'
example:
code: 'no_permission_for_deleted'
summary: only admins can see deleted projects.
tags:
- Sources - Projects

0 comments on commit be1d559

Please sign in to comment.