Skip to content

Commit

Permalink
urls: Create endpoint to link two series
Browse files Browse the repository at this point in the history
Closes getpatchwork#506

Signed-off-by: andrepapoti <[email protected]>
  • Loading branch information
andrepapoti committed Apr 10, 2024
1 parent ae661f8 commit 45cd25d
Show file tree
Hide file tree
Showing 4 changed files with 3,350 additions and 3 deletions.
4 changes: 2 additions & 2 deletions docs/api/schemas/generate-schemas.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
yaml = None

ROOT_DIR = os.path.dirname(os.path.realpath(__file__))
VERSIONS = [(1, 0), (1, 1), (1, 2), (1, 3), None]
LATEST_VERSION = (1, 3)
VERSIONS = [(1, 0), (1, 1), (1, 2), (1, 3), (1, 4), None]
LATEST_VERSION = (1, 4)


def generate_schemas():
Expand Down
41 changes: 40 additions & 1 deletion docs/api/schemas/latest/patchwork.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ info:
license:
name: GPL v2 License
url: https://www.gnu.org/licenses/gpl-2.0.html
version: '1.3'
version: '1.4'
paths:
/api:
get:
Expand Down Expand Up @@ -1223,6 +1223,38 @@ paths:
$ref: '#/components/schemas/Error'
tags:
- series
patch:
summary: Link both series.
description: |
Apply a partial update to a Series
operationId: series_link
responses:
'200':
description: 'Updated series'
content:
application/json:
schema:
$ref: '#/components/schemas/Series'
'400':
description: 'Bad request'
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'403':
description: 'Forbidden'
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'404':
description: 'Not found'
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
tags:
- series
/api/users:
get:
summary: List users.
Expand Down Expand Up @@ -2605,6 +2637,13 @@ components:
$ref: '#/components/schemas/PatchEmbedded'
readOnly: true
uniqueItems: true
related_series:
title: Related series
type: array
items:
$ref: '#/components/schemas/Series'
readOnly: true
uniqueItems: true
User:
type: object
title: User
Expand Down
43 changes: 43 additions & 0 deletions docs/api/schemas/patchwork.j2
Original file line number Diff line number Diff line change
Expand Up @@ -1248,6 +1248,40 @@ paths:
$ref: '#/components/schemas/Error'
tags:
- series
{% if version >= (1, 4) %}
patch:
summary: Link both series.
description: |
Apply a partial update to a Series
operationId: series_link
responses:
'200':
description: 'Updated series'
content:
application/json:
schema:
$ref: '#/components/schemas/Series'
'400':
description: 'Bad request'
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'403':
description: 'Forbidden'
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'404':
description: 'Not found'
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
tags:
- series
{% endif %}
/api/{{ version_url }}users:
get:
summary: List users.
Expand Down Expand Up @@ -2699,6 +2733,15 @@ components:
$ref: '#/components/schemas/PatchEmbedded'
readOnly: true
uniqueItems: true
{% if version >= (1, 4) %}
related_series:
title: Related series
type: array
items:
$ref: '#/components/schemas/Series'
readOnly: true
uniqueItems: true
{% endif %}
User:
type: object
title: User
Expand Down
Loading

0 comments on commit 45cd25d

Please sign in to comment.