Skip to content

Commit

Permalink
Use relative paths in $ref definitions
Browse files Browse the repository at this point in the history
Make remote references independent from the path where OBS and its
documentation is located.
  • Loading branch information
eduardoj committed Jan 7, 2021
1 parent 1062336 commit 685e975
Show file tree
Hide file tree
Showing 8 changed files with 33 additions and 33 deletions.
10 changes: 5 additions & 5 deletions src/api/public/apidocs-new/OBS-v2.10.50.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,19 @@ info:

paths:
/about:
$ref: '/apidocs-new/paths/about.yaml'
$ref: 'paths/about.yaml'

/architectures:
$ref: '/apidocs-new/paths/architectures.yaml'
$ref: 'paths/architectures.yaml'

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

/group:
$ref: '/apidocs-new/paths/group.yaml'
$ref: 'paths/group.yaml'

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

components:
securitySchemes:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ description: OK. The request has succeeded.
content:
application/xml; charset=utf-8:
schema:
$ref: '/apidocs-new/components/schemas/api_response.yaml'
$ref: '../schemas/api_response.yaml'
example:
code: ok
summary: Ok
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ description: Unauthorized.
content:
application/xml; charset=utf-8:
schema:
$ref: '/apidocs-new/components/schemas/api_response.yaml'
$ref: '../schemas/api_response.yaml'
examples:
anonymous_user:
value:
Expand Down
2 changes: 1 addition & 1 deletion src/api/public/apidocs-new/paths/about.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ get:
content:
application/xml; charset=utf-8:
schema:
$ref: '/apidocs-new/components/schemas/about.yaml'
$ref: '../components/schemas/about.yaml'
tags:
- General Information
4 changes: 2 additions & 2 deletions src/api/public/apidocs-new/paths/architectures.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ get:
content:
application/xml; charset=utf-8:
schema:
$ref: '/apidocs-new/components/schemas/directory.yaml'
$ref: '../components/schemas/directory.yaml'
example:
count: '4'
entry:
Expand All @@ -21,6 +21,6 @@ get:
- name: 's390x'
- name: 'x86_64'
'401':
$ref: '/apidocs-new/components/responses/unauthorized.yaml'
$ref: '../components/responses/unauthorized.yaml'
tags:
- General Information
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ get:
security:
- basic_authentication: []
parameters:
- $ref: '/apidocs-new/components/parameters/architecture_name.yaml'
- $ref: '../components/parameters/architecture_name.yaml'
responses:
'200':
description: OK. The request has succeeded.
Expand All @@ -22,13 +22,13 @@ get:
example:
name: 'x86_64'
'401':
$ref: '/apidocs-new/components/responses/unauthorized.yaml'
$ref: '../components/responses/unauthorized.yaml'
'404':
description: Not Found.
content:
application/xml; charset=utf-8:
schema:
$ref: '/apidocs-new/components/schemas/api_response.yaml'
$ref: '../components/schemas/api_response.yaml'
example:
code: unknown_architecture
summary: 'Architecture does not exist: x999'
Expand Down
4 changes: 2 additions & 2 deletions src/api/public/apidocs-new/paths/group.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ get:
content:
application/xml; charset=utf-8:
schema:
$ref: '/apidocs-new/components/schemas/directory.yaml'
$ref: '../components/schemas/directory.yaml'
example:
count: '2'
entry:
- name: 'group-admin'
- name: 'group-test'
'401':
$ref: '/apidocs-new/components/responses/unauthorized.yaml'
$ref: '../components/responses/unauthorized.yaml'
tags:
- Groups
36 changes: 18 additions & 18 deletions src/api/public/apidocs-new/paths/group_group_title.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,22 @@ get:
security:
- basic_authentication: []
parameters:
- $ref: '/apidocs-new/components/parameters/group_title.yaml'
- $ref: '../components/parameters/group_title.yaml'
responses:
'200':
description: OK. The request has succeeded.
content:
application/xml; charset=utf-8:
schema:
$ref: '/apidocs-new/components/schemas/group.yaml'
$ref: '../components/schemas/group.yaml'
'401':
$ref: '/apidocs-new/components/responses/unauthorized.yaml'
$ref: '../components/responses/unauthorized.yaml'
'404':
description: Not Found.
content:
application/xml; charset=utf-8:
schema:
$ref: '/apidocs-new/components/schemas/api_response.yaml'
$ref: '../components/schemas/api_response.yaml'
example:
code: not_found
summary: Couldn't find Group 'group-testd'
Expand All @@ -32,7 +32,7 @@ post:
security:
- basic_authentication: []
parameters:
- $ref: '/apidocs-new/components/parameters/group_title.yaml'
- $ref: '../components/parameters/group_title.yaml'
- in: query
name: cmd
schema:
Expand All @@ -55,24 +55,24 @@ post:
description: Group email. Used with `cmd=set_email`.
responses:
'200':
$ref: '/apidocs-new/components/responses/succeeded.yaml'
$ref: '../components/responses/succeeded.yaml'
'400':
description: Bad Request.
content:
application/xml; charset=utf-8:
schema:
$ref: '/apidocs-new/components/schemas/api_response.yaml'
$ref: '../components/schemas/api_response.yaml'
example:
code: bad_request
summary: cmd must be set to add_user or remove_user
'401':
$ref: '/apidocs-new/components/responses/unauthorized.yaml'
$ref: '../components/responses/unauthorized.yaml'
'404':
description: Not Found.
content:
application/xml; charset=utf-8:
schema:
$ref: '/apidocs-new/components/schemas/api_response.yaml'
$ref: '../components/schemas/api_response.yaml'
examples:
user_not_found:
value:
Expand All @@ -93,25 +93,25 @@ put:
security:
- basic_authentication: []
parameters:
- $ref: '/apidocs-new/components/parameters/group_title.yaml'
- $ref: '../components/parameters/group_title.yaml'
requestBody:
description: Group definition.
required: true
content:
application/xml; charset=utf-8:
schema:
$ref: '/apidocs-new/components/schemas/group.yaml'
$ref: '../components/schemas/group.yaml'
responses:
'200':
$ref: '/apidocs-new/components/responses/succeeded.yaml'
$ref: '../components/responses/succeeded.yaml'
'401':
$ref: '/apidocs-new/components/responses/unauthorized.yaml'
$ref: '../components/responses/unauthorized.yaml'
'404':
description: Not Found.
content:
application/xml; charset=utf-8:
schema:
$ref: '/apidocs-new/components/schemas/api_response.yaml'
$ref: '../components/schemas/api_response.yaml'
example:
code: not_found
summary: Couldn't find Group 'group-testd'
Expand All @@ -124,18 +124,18 @@ delete:
security:
- basic_authentication: []
parameters:
- $ref: '/apidocs-new/components/parameters/group_title.yaml'
- $ref: '../components/parameters/group_title.yaml'
responses:
'200':
$ref: '/apidocs-new/components/responses/succeeded.yaml'
$ref: '../components/responses/succeeded.yaml'
'401':
$ref: '/apidocs-new/components/responses/unauthorized.yaml'
$ref: '../components/responses/unauthorized.yaml'
'404':
description: Not Found.
content:
application/xml; charset=utf-8:
schema:
$ref: '/apidocs-new/components/schemas/api_response.yaml'
$ref: '../components/schemas/api_response.yaml'
example:
code: not_found
summary: Couldn't find Group 'group-testd'
Expand Down

0 comments on commit 685e975

Please sign in to comment.