Skip to content

Commit 702fb25

Browse files
committed
docs: Document endpoint to link two series
Closes getpatchwork#506 Signed-off-by: andrepapoti <[email protected]>
1 parent 2b2859c commit 702fb25

File tree

4 files changed

+3425
-3
lines changed

4 files changed

+3425
-3
lines changed

docs/api/schemas/generate-schemas.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
yaml = None
1515

1616
ROOT_DIR = os.path.dirname(os.path.realpath(__file__))
17-
VERSIONS = [(1, 0), (1, 1), (1, 2), (1, 3), None]
18-
LATEST_VERSION = (1, 3)
17+
VERSIONS = [(1, 0), (1, 1), (1, 2), (1, 3), (1, 4), None]
18+
LATEST_VERSION = (1, 4)
1919

2020

2121
def generate_schemas():

docs/api/schemas/latest/patchwork.yaml

+65-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ info:
1313
license:
1414
name: GPL v2 License
1515
url: https://www.gnu.org/licenses/gpl-2.0.html
16-
version: '1.3'
16+
version: '1.4'
1717
paths:
1818
/api:
1919
get:
@@ -1223,6 +1223,42 @@ paths:
12231223
$ref: '#/components/schemas/Error'
12241224
tags:
12251225
- series
1226+
patch:
1227+
summary: Link series to set a relationship between them
1228+
description: |
1229+
Apply a partial update to a Series, where only a few fields of the model are allowed:
1230+
- previous_series: Set the provided series as coming before the one specified by the id;
1231+
- subsequent_series: Set the provided series as coming after the one specified by the id;
1232+
- required_series: Set the provided series as requirements for one specified by the id;
1233+
- required_by_series: Set the series specified by the id as a requirement for the provided ones.
1234+
operationId: series_link
1235+
responses:
1236+
'200':
1237+
description: 'Updated series'
1238+
content:
1239+
application/json:
1240+
schema:
1241+
$ref: '#/components/schemas/Series'
1242+
'400':
1243+
description: 'Bad request'
1244+
content:
1245+
application/json:
1246+
schema:
1247+
$ref: '#/components/schemas/Error'
1248+
'403':
1249+
description: 'Forbidden'
1250+
content:
1251+
application/json:
1252+
schema:
1253+
$ref: '#/components/schemas/Error'
1254+
'404':
1255+
description: 'Not found'
1256+
content:
1257+
application/json:
1258+
schema:
1259+
$ref: '#/components/schemas/Error'
1260+
tags:
1261+
- series
12261262
/api/users:
12271263
get:
12281264
summary: List users.
@@ -2605,6 +2641,34 @@ components:
26052641
$ref: '#/components/schemas/PatchEmbedded'
26062642
readOnly: true
26072643
uniqueItems: true
2644+
previous_series:
2645+
title: Previous series
2646+
type: array
2647+
items:
2648+
$ref: '#/components/schemas/Series'
2649+
readOnly: true
2650+
uniqueItems: true
2651+
subsequent_series:
2652+
title: Subsequent series
2653+
type: array
2654+
items:
2655+
$ref: '#/components/schemas/Series'
2656+
readOnly: true
2657+
uniqueItems: true
2658+
required_series:
2659+
title: Required series
2660+
type: array
2661+
items:
2662+
$ref: '#/components/schemas/Series'
2663+
readOnly: true
2664+
uniqueItems: true
2665+
required_by_series:
2666+
title: Required by series
2667+
type: array
2668+
items:
2669+
$ref: '#/components/schemas/Series'
2670+
readOnly: true
2671+
uniqueItems: true
26082672
User:
26092673
type: object
26102674
title: User

docs/api/schemas/patchwork.j2

+68
Original file line numberDiff line numberDiff line change
@@ -1248,6 +1248,44 @@ paths:
12481248
$ref: '#/components/schemas/Error'
12491249
tags:
12501250
- series
1251+
{% if version >= (1, 4) %}
1252+
patch:
1253+
summary: Link series to set a relationship between them
1254+
description: |
1255+
Apply a partial update to a Series, where only a few fields of the model are allowed:
1256+
- previous_series: Set the provided series as coming before the one specified by the id;
1257+
- subsequent_series: Set the provided series as coming after the one specified by the id;
1258+
- required_series: Set the provided series as requirements for one specified by the id;
1259+
- required_by_series: Set the series specified by the id as a requirement for the provided ones.
1260+
operationId: series_link
1261+
responses:
1262+
'200':
1263+
description: 'Updated series'
1264+
content:
1265+
application/json:
1266+
schema:
1267+
$ref: '#/components/schemas/Series'
1268+
'400':
1269+
description: 'Bad request'
1270+
content:
1271+
application/json:
1272+
schema:
1273+
$ref: '#/components/schemas/Error'
1274+
'403':
1275+
description: 'Forbidden'
1276+
content:
1277+
application/json:
1278+
schema:
1279+
$ref: '#/components/schemas/Error'
1280+
'404':
1281+
description: 'Not found'
1282+
content:
1283+
application/json:
1284+
schema:
1285+
$ref: '#/components/schemas/Error'
1286+
tags:
1287+
- series
1288+
{% endif %}
12511289
/api/{{ version_url }}users:
12521290
get:
12531291
summary: List users.
@@ -2699,6 +2737,36 @@ components:
26992737
$ref: '#/components/schemas/PatchEmbedded'
27002738
readOnly: true
27012739
uniqueItems: true
2740+
{% if version >= (1, 4) %}
2741+
previous_series:
2742+
title: Previous series
2743+
type: array
2744+
items:
2745+
$ref: '#/components/schemas/Series'
2746+
readOnly: true
2747+
uniqueItems: true
2748+
subsequent_series:
2749+
title: Subsequent series
2750+
type: array
2751+
items:
2752+
$ref: '#/components/schemas/Series'
2753+
readOnly: true
2754+
uniqueItems: true
2755+
required_series:
2756+
title: Required series
2757+
type: array
2758+
items:
2759+
$ref: '#/components/schemas/Series'
2760+
readOnly: true
2761+
uniqueItems: true
2762+
required_by_series:
2763+
title: Required by series
2764+
type: array
2765+
items:
2766+
$ref: '#/components/schemas/Series'
2767+
readOnly: true
2768+
uniqueItems: true
2769+
{% endif %}
27022770
User:
27032771
type: object
27042772
title: User

0 commit comments

Comments
 (0)