Skip to content

Commit

Permalink
Document /issue_trackers routes with OpenAPI
Browse files Browse the repository at this point in the history
  • Loading branch information
eduardoj committed Jan 20, 2021
1 parent 3f372cf commit 93de152
Show file tree
Hide file tree
Showing 4 changed files with 101 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/api/public/apidocs-new/OBS-v2.10.50.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ servers:
tags:
- name: General Information
- name: Groups
- name: Issue Trackers
- name: Person

info:
Expand All @@ -25,16 +26,17 @@ paths:

/architectures:
$ref: 'paths/architectures.yaml'

/architectures/{architecture_name}:
$ref: 'paths/architectures_architecture_name.yaml'

/group:
$ref: 'paths/group.yaml'

/group/{group_title}:
$ref: 'paths/group_group_title.yaml'

/issue_trackers:
$ref: 'paths/issue_trackers.yaml'

/person:
$ref: 'paths/person.yaml'

Expand Down
28 changes: 28 additions & 0 deletions src/api/public/apidocs-new/components/schemas/issue_tracker.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
type: object
properties:
name:
type: string
example: fate
kind:
type: string
example: fate
description:
type: string
example: openSUSE Feature Database
url:
type: string
example: 'https://features.opensuse.org/'
show-url:
type: string
example: 'https://features.opensuse.org/@@@'
regex:
type: string
example: '(?:fate|Fate|FATE)\s*#\s*(\d+)'
label:
type: string
example: 'fate#@@@'
enable-fetch:
type: string
example: 'false'
xml:
name: issue-tracker
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
type: array
items:
$ref: 'issue_tracker.yaml'
xml:
name: issue-trackers
wrapped: true

62 changes: 62 additions & 0 deletions src/api/public/apidocs-new/paths/issue_trackers.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
get:
summary: Get the list of issue trackers.
description: Get the list of issue trackers.
security:
- basic_authentication: []
responses:
'200':
description: |
List of issue trackers.
XML Schema used for body validation: [issue_trackers.rng](../schema/issue_trackers.rng)
content:
application/xml; charset=utf-8:
schema:
$ref: '../components/schemas/list_issue_trackers.yaml'
'401':
$ref: '../components/responses/unauthorized.yaml'
tags:
- Issue Trackers

post:
summary: Create an issue tracker.
description: Create an issue tracker.
security:
- basic_authentication: []
requestBody:
description: |
Issue tracker definition.
XML Schema used for body validation: [issue_tracker.rng](../schema/issue_tracker.rng)
required: true
content:
application/xml; charset=utf-8:
schema:
$ref: '../components/schemas/issue_tracker.yaml'
responses:
'200':
$ref: '../components/responses/succeeded.yaml'
'400':
description: |
Validation failed.
XML Schema used for body validation: [status.xsd](../schema/status.xsd)
content:
application/xml; charset=utf-8:
schema:
$ref: '../components/schemas/api_response.yaml'
examples:
empty_body:
value:
code: validation_failed
summary: Document is empty, not allowed for issue_tracker
summary: Empty Body
wrong_xml_element:
value:
code: validation_failed
summary: 'issue_tracker validation error: 1:0: ERROR: Expecting element issue-tracker, got foo'
summary: Wrong XML Element
'401':
$ref: '../components/responses/unauthorized.yaml'
tags:
- Issue Trackers

0 comments on commit 93de152

Please sign in to comment.