]> git.ipfire.org Git - thirdparty/patchwork.git/commitdiff
docs: Resolve issues with 'projects'
authorStephen Finucane <stephen@that.guru>
Wed, 15 Apr 2020 23:43:40 +0000 (00:43 +0100)
committerStephen Finucane <stephen@that.guru>
Sat, 18 Apr 2020 10:57:28 +0000 (11:57 +0100)
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 <stephen@that.guru>
docs/api/schemas/latest/patchwork.yaml
docs/api/schemas/patchwork.j2
docs/api/schemas/v1.0/patchwork.yaml
docs/api/schemas/v1.1/patchwork.yaml
docs/api/schemas/v1.2/patchwork.yaml
patchwork/tests/api/test_project.py

index e0054b929bcb09601c5cf8b0e912727dedd04da2..dbfa0aab30bd5820fb83a7ef30bb0484095619aa 100644 (file)
@@ -865,7 +865,8 @@ paths:
         required: true
         schema:
           title: ID
-          type: integer
+          # TODO: Add regex?
+          type: string
     get:
       description: Show a project.
       operationId: projects_read
index 66904d035515d4307955f6e94cd346227ed452df..f4628ee233a82e986aa16e2652970d7e447b6a6c 100644 (file)
@@ -886,7 +886,8 @@ paths:
         required: true
         schema:
           title: ID
-          type: integer
+          # TODO: Add regex?
+          type: string
     get:
       description: Show a project.
       operationId: projects_read
index 9205c4f02afe16ccb238411386ba18aadd00767a..a2b1b858feb796b01c308f5a6a4bfcca75556569 100644 (file)
@@ -726,7 +726,8 @@ paths:
         required: true
         schema:
           title: ID
-          type: integer
+          # TODO: Add regex?
+          type: string
     get:
       description: Show a project.
       operationId: projects_read
index 993bf51f0b8f86e13bcd8637650f3ad8e81f2ad8..dcec32efc6123902091dfce940b3e525a7b66288 100644 (file)
@@ -726,7 +726,8 @@ paths:
         required: true
         schema:
           title: ID
-          type: integer
+          # TODO: Add regex?
+          type: string
     get:
       description: Show a project.
       operationId: projects_read
index aac70321dae37adaf10a2e0ecd6e9fd06d009a04..1b69229045392a2eec9d25db597e4e3703e87aca 100644 (file)
@@ -865,7 +865,8 @@ paths:
         required: true
         schema:
           title: ID
-          type: integer
+          # TODO: Add regex?
+          type: string
     get:
       description: Show a project.
       operationId: projects_read
index 5a7676740affe779b5c952d7501bbda827acb830..bf87a563024941c0c7700558750cc7a244a9c3bc 100644 (file)
@@ -196,8 +196,11 @@ class TestProjectAPI(utils.APITestCase):
 
         user = create_maintainer(project)
         self.client.force_authenticate(user=user)
-        resp = self.client.patch(self.api_url(project.id), {
-            'link_name': 'test'})
+        resp = self.client.patch(
+            self.api_url(project.id),
+            {'link_name': 'test'},
+            validate_request=False,
+        )
         # NOTE(stephenfin): This actually returns HTTP 200 due to
         # https://github.com/encode/django-rest-framework/issues/1655
         self.assertEqual(status.HTTP_200_OK, resp.status_code)