Skip to content

Commit b727fee

Browse files
committed
urls: Create endpoint to link two series
Closes getpatchwork#506 Signed-off-by: andrepapoti <[email protected]>
1 parent d71a315 commit b727fee

File tree

4 files changed

+3350
-3
lines changed

4 files changed

+3350
-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

+40-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,38 @@ paths:
12231223
$ref: '#/components/schemas/Error'
12241224
tags:
12251225
- series
1226+
patch:
1227+
summary: Link both series.
1228+
description: |
1229+
Apply a partial update to a Series
1230+
operationId: series_link
1231+
responses:
1232+
'200':
1233+
description: 'Updated series'
1234+
content:
1235+
application/json:
1236+
schema:
1237+
$ref: '#/components/schemas/Series'
1238+
'400':
1239+
description: 'Bad request'
1240+
content:
1241+
application/json:
1242+
schema:
1243+
$ref: '#/components/schemas/Error'
1244+
'403':
1245+
description: 'Forbidden'
1246+
content:
1247+
application/json:
1248+
schema:
1249+
$ref: '#/components/schemas/Error'
1250+
'404':
1251+
description: 'Not found'
1252+
content:
1253+
application/json:
1254+
schema:
1255+
$ref: '#/components/schemas/Error'
1256+
tags:
1257+
- series
12261258
/api/users:
12271259
get:
12281260
summary: List users.
@@ -2605,6 +2637,13 @@ components:
26052637
$ref: '#/components/schemas/PatchEmbedded'
26062638
readOnly: true
26072639
uniqueItems: true
2640+
related_series:
2641+
title: Related series
2642+
type: array
2643+
items:
2644+
$ref: '#/components/schemas/Series'
2645+
readOnly: true
2646+
uniqueItems: true
26082647
User:
26092648
type: object
26102649
title: User

docs/api/schemas/patchwork.j2

+43
Original file line numberDiff line numberDiff line change
@@ -1248,6 +1248,40 @@ paths:
12481248
$ref: '#/components/schemas/Error'
12491249
tags:
12501250
- series
1251+
{% if version >= (1, 4) %}
1252+
patch:
1253+
summary: Link both series.
1254+
description: |
1255+
Apply a partial update to a Series
1256+
operationId: series_link
1257+
responses:
1258+
'200':
1259+
description: 'Updated series'
1260+
content:
1261+
application/json:
1262+
schema:
1263+
$ref: '#/components/schemas/Series'
1264+
'400':
1265+
description: 'Bad request'
1266+
content:
1267+
application/json:
1268+
schema:
1269+
$ref: '#/components/schemas/Error'
1270+
'403':
1271+
description: 'Forbidden'
1272+
content:
1273+
application/json:
1274+
schema:
1275+
$ref: '#/components/schemas/Error'
1276+
'404':
1277+
description: 'Not found'
1278+
content:
1279+
application/json:
1280+
schema:
1281+
$ref: '#/components/schemas/Error'
1282+
tags:
1283+
- series
1284+
{% endif %}
12511285
/api/{{ version_url }}users:
12521286
get:
12531287
summary: List users.
@@ -2699,6 +2733,15 @@ components:
26992733
$ref: '#/components/schemas/PatchEmbedded'
27002734
readOnly: true
27012735
uniqueItems: true
2736+
{% if version >= (1, 4) %}
2737+
related_series:
2738+
title: Related series
2739+
type: array
2740+
items:
2741+
$ref: '#/components/schemas/Series'
2742+
readOnly: true
2743+
uniqueItems: true
2744+
{% endif %}
27022745
User:
27032746
type: object
27042747
title: User

0 commit comments

Comments
 (0)