-
Notifications
You must be signed in to change notification settings - Fork 437
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #10605 from eduardoj/document_attribute_routes_wit…
…h_openapi Document '/attribute' API routes with OpenAPI
- Loading branch information
Showing
10 changed files
with
575 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
src/api/public/apidocs-new/components/parameters/attribute_name.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
in: path | ||
name: attribute_name | ||
schema: | ||
type: string | ||
required: true | ||
description: The name of the attribute | ||
example: OwnerRootProjectTest |
7 changes: 7 additions & 0 deletions
7
src/api/public/apidocs-new/components/parameters/namespace.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
in: path | ||
name: namespace | ||
schema: | ||
type: string | ||
required: true | ||
description: The namespace | ||
example: OBS_TEST |
40 changes: 40 additions & 0 deletions
40
src/api/public/apidocs-new/components/schemas/attribute.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
type: object | ||
properties: | ||
name: | ||
type: string | ||
example: 'OBS_TEST' | ||
xml: | ||
attribute: true | ||
namespace: | ||
type: string | ||
example: 'OwnerRootProjectTest' | ||
xml: | ||
attribute: true | ||
description: | ||
type: string | ||
example: 'An example description for an attribute.' | ||
allowed: | ||
type: object | ||
properties: | ||
value: | ||
type: array | ||
items: | ||
type: string | ||
example: | ||
- 'DisableDevelTest' | ||
- 'BugownerOnlyTest' | ||
count: | ||
type: integer | ||
example: 0 | ||
modifiable_by: | ||
type: array | ||
items: | ||
type: object | ||
properties: | ||
user: | ||
type: string | ||
example: 'user_login_name' | ||
xml: | ||
attribute: true | ||
xml: | ||
name: definition |
19 changes: 19 additions & 0 deletions
19
src/api/public/apidocs-new/components/schemas/namespace.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
type: object | ||
properties: | ||
name: | ||
type: string | ||
example: 'OBS_TEST' | ||
xml: | ||
attribute: true | ||
modifiable_by: | ||
type: array | ||
items: | ||
type: object | ||
properties: | ||
user: | ||
type: string | ||
example: 'user_login_name' | ||
xml: | ||
attribute: true | ||
xml: | ||
name: namespace |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
get: | ||
summary: List all attribute namespaces. | ||
description: List all attribute namespaces. | ||
security: | ||
- basic_authentication: [] | ||
responses: | ||
'200': | ||
description: | | ||
OK. The request has succeeded. | ||
XML Schema used for body validation: [directory.xsd](../schema/directory.xsd) | ||
content: | ||
application/xml; charset=utf-8: | ||
schema: | ||
$ref: '../components/schemas/directory.yaml' | ||
example: | ||
count: '2' | ||
entry: | ||
- name: 'OBS' | ||
- name: 'openSUSE' | ||
'401': | ||
$ref: '../components/responses/unauthorized.yaml' | ||
tags: | ||
- Attribute Namespaces |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
get: | ||
summary: List all attributes below a namespace. | ||
description: List all attributes under a given attribute namespace. | ||
security: | ||
- basic_authentication: [] | ||
parameters: | ||
- $ref: '../components/parameters/namespace.yaml' | ||
responses: | ||
'200': | ||
description: | | ||
OK. The request has succeeded. | ||
XML Schema used for body validation: [directory.xsd](../schema/directory.xsd) | ||
content: | ||
application/xml; charset=utf-8: | ||
schema: | ||
$ref: '../components/schemas/directory.yaml' | ||
example: | ||
count: '2' | ||
entry: | ||
- name: 'AutoCleanup' | ||
- name: 'OwnerRootProject' | ||
'401': | ||
$ref: '../components/responses/unauthorized.yaml' | ||
'404': | ||
description: Not Found. | ||
content: | ||
application/xml; charset=utf-8: | ||
schema: | ||
$ref: '../components/schemas/api_response.yaml' | ||
example: | ||
code: not_found | ||
summary: Couldn't find AttribNamespace | ||
tags: | ||
- Attribute Namespaces | ||
|
||
delete: | ||
summary: Delete an attribute namespace and all attributes below. | ||
description: | | ||
Delete an attribute namespace and all attributes below. | ||
This operation is the same as the one defined with [DELETE /attribute/{namespace}/_meta](#/Attributes/delete_attribute__namespace___meta). | ||
security: | ||
- basic_authentication: [] | ||
parameters: | ||
- $ref: '../components/parameters/namespace.yaml' | ||
responses: | ||
'200': | ||
$ref: '../components/responses/succeeded.yaml' | ||
'401': | ||
$ref: '../components/responses/unauthorized.yaml' | ||
tags: | ||
- Attribute Namespaces |
30 changes: 30 additions & 0 deletions
30
src/api/public/apidocs-new/paths/attribute_namespace_attribute_name.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
delete: | ||
summary: Delete an attribute and all its values in projects or packages. | ||
description: | | ||
Delete an attribute and all its values in projects or packages. | ||
This operation is the same as the one defined with [DELETE /attribute/{namespace}/{attribute_name}/_meta](#/Attributes/delete_attribute__namespace___attribute_name___meta) | ||
security: | ||
- basic_authentication: [] | ||
parameters: | ||
- $ref: '../components/parameters/namespace.yaml' | ||
- $ref: '../components/parameters/attribute_name.yaml' | ||
responses: | ||
'200': | ||
$ref: '../components/responses/succeeded.yaml' | ||
'401': | ||
$ref: '../components/responses/unauthorized.yaml' | ||
'404': | ||
description: Not Found. | ||
content: | ||
application/xml; charset=utf-8: | ||
schema: | ||
$ref: '../components/schemas/api_response.yaml' | ||
examples: | ||
namespace: | ||
value: | ||
code: not_found | ||
summary: Couldn't find AttribNamespace | ||
summary: Not Found (Namespace) | ||
tags: | ||
- Attributes |
Oops, something went wrong.