Skip to content

Commit

Permalink
Merge pull request #13989 from saraycp/adjust_project_attribute_endpoint
Browse files Browse the repository at this point in the history
Adjust GET `/source/{project_name}/_attribute/{attribute_name}` endpoint
  • Loading branch information
saraycp authored Mar 14, 2023
2 parents 2ba47f6 + f46177f commit e3b78a3
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 25 deletions.
2 changes: 1 addition & 1 deletion src/api/public/apidocs-new/OBS-v2.10.50.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ paths:
/source/{project_name}/_pubkey:
$ref: 'paths/source_project_name_pubkey.yaml'
/source/{project_name}/_attribute/{attribute_name}:
$ref: 'paths/source_project_name_attribute_name.yaml'
$ref: 'paths/source_project_name_attribute_attribute_name.yaml'
/source/{project_name}/_project/{file_name}:
$ref: 'paths/source_project_name_project_file.yaml'
/source/{project_name}?cmd=addchannels:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@ type: array
items:
type: object
properties:
attribute:
type: object
properties:
name:
type: string
xml:
attribute: true
namespace:
type: string
xml:
attribute: true
name:
type: string
xml:
attribute: true
namespace:
type: string
xml:
attribute: true
xml:
name: attribute
xml:
name: attributes
wrapped: true
Original file line number Diff line number Diff line change
Expand Up @@ -5,30 +5,47 @@ get:
parameters:
- $ref: '../components/parameters/project_name.yaml'
- $ref: '../components/parameters/attribute_name.yaml'
- name: meta
# Query Strings:
# `rev`: doesn't make sense in project level and makes the endpoint crash.
# `meta`: either you pass `meta` or not, it's always replaced by meta: 1.
# `with_project`: does not make sense in project level and makes the endpoint crash.
- name: view
in: query
schema:
type: string
- name: rev
enum:
- blame
description: With view=blame, information about who changed each XML tag and when is displayed.
example: blame
- name: with_default
in: query
schema:
type: string
- name: view
in: query
schema:
type: string
description: The value of this parameter should only be `blame`
description: |
If the attribute doesn't contain any value and `with_default` is present,
the default values will be displayed, if any.
example: 1
responses:
'200':
description: OK. The request has succeeded.
content:
application/xml; charset=utf-8:
schema:
$ref: '../components/schemas/source/attributes.yaml'
example:
attribute:
name: MaintenanceProject
namespace: OBS
examples:
oneAttribute:
value:
- name: MaintenanceProject
namespace: OBS
viewBlame:
description: Passing view=blame.
value: |
6 (Admin 2023-03-09 11:46:01 1) <attributes>
12 (Iggy 2023-03-13 14:46:01 5) <attribute namespace="OBS" name="MakeOriginOlder"/>
14 (Admin 2023-03-13 15:14:21 6) <attribute namespace="OBS" name="QualityCategory">
14 (Admin 2023-03-13 15:14:21 7) <value>Development</value>
14 (Admin 2023-03-13 15:14:21 8) </attribute>
6 (Admin 2023-03-09 11:46:01 9) </attributes>
'400':
description: Wrong value for deleted parameter.
content:
Expand Down Expand Up @@ -65,8 +82,7 @@ post:
schema:
$ref: '../components/schemas/source/attributes.yaml'
example:
attribute:
name: MaintenanceProject
- name: MaintenanceProject
namespace: OBS
responses:
'200':
Expand Down

0 comments on commit e3b78a3

Please sign in to comment.