Skip to content

Commit 48f27d5

Browse files
committed
docs: Resolve issues with 'projects'
Two issues here: - The ID in '/projects/{id}' can be either an integer or a string. - We were attempting to validate an invalid request. Signed-off-by: Stephen Finucane <[email protected]>
1 parent 2047107 commit 48f27d5

File tree

6 files changed

+15
-7
lines changed

6 files changed

+15
-7
lines changed

docs/api/schemas/latest/patchwork.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -865,7 +865,8 @@ paths:
865865
required: true
866866
schema:
867867
title: ID
868-
type: integer
868+
# TODO: Add regex?
869+
type: string
869870
get:
870871
description: Show a project.
871872
operationId: projects_read

docs/api/schemas/patchwork.j2

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -886,7 +886,8 @@ paths:
886886
required: true
887887
schema:
888888
title: ID
889-
type: integer
889+
# TODO: Add regex?
890+
type: string
890891
get:
891892
description: Show a project.
892893
operationId: projects_read

docs/api/schemas/v1.0/patchwork.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -726,7 +726,8 @@ paths:
726726
required: true
727727
schema:
728728
title: ID
729-
type: integer
729+
# TODO: Add regex?
730+
type: string
730731
get:
731732
description: Show a project.
732733
operationId: projects_read

docs/api/schemas/v1.1/patchwork.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -726,7 +726,8 @@ paths:
726726
required: true
727727
schema:
728728
title: ID
729-
type: integer
729+
# TODO: Add regex?
730+
type: string
730731
get:
731732
description: Show a project.
732733
operationId: projects_read

docs/api/schemas/v1.2/patchwork.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -865,7 +865,8 @@ paths:
865865
required: true
866866
schema:
867867
title: ID
868-
type: integer
868+
# TODO: Add regex?
869+
type: string
869870
get:
870871
description: Show a project.
871872
operationId: projects_read

patchwork/tests/api/test_project.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,8 +196,11 @@ def test_update_readonly_field(self):
196196

197197
user = create_maintainer(project)
198198
self.client.force_authenticate(user=user)
199-
resp = self.client.patch(self.api_url(project.id), {
200-
'link_name': 'test'})
199+
resp = self.client.patch(
200+
self.api_url(project.id),
201+
{'link_name': 'test'},
202+
validate_request=False,
203+
)
201204
# NOTE(stephenfin): This actually returns HTTP 200 due to
202205
# https://github.com/encode/django-rest-framework/issues/1655
203206
self.assertEqual(status.HTTP_200_OK, resp.status_code)

0 commit comments

Comments
 (0)