]> git.ipfire.org Git - thirdparty/patchwork.git/commitdiff
openapi: Fix issues with events API
authorStephen Finucane <stephen@that.guru>
Sun, 21 Jan 2024 10:34:41 +0000 (10:34 +0000)
committerStephen Finucane <stephen@that.guru>
Sun, 21 Jan 2024 10:34:41 +0000 (10:34 +0000)
The previous_delegate and current_delegate fields are nullable.

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
docs/api/schemas/v1.3/patchwork.yaml
patchwork/tests/api/test_event.py

index 2d60a2c322f2136c2cffabed41e10dc2ad8be21e..7bed54511830aa5ca97a97db0496211a3fca611d 100644 (file)
@@ -2000,9 +2000,21 @@ components:
                 patch:
                   $ref: '#/components/schemas/PatchEmbedded'
                 previous_delegate:
-                  $ref: '#/components/schemas/UserEmbedded'
+                  title: Previous delegate
+                  type:
+                    - 'null'
+                    - 'object'
+                  oneOf:
+                    - type: 'null'
+                    - $ref: '#/components/schemas/UserEmbedded'
                 current_delegate:
-                  $ref: '#/components/schemas/UserEmbedded'
+                  title: Current delegate
+                  type:
+                    - 'null'
+                    - 'object'
+                  oneOf:
+                    - type: 'null'
+                    - $ref: '#/components/schemas/UserEmbedded'
     EventCheckCreated:
       title: Check create event
       description: |
index 7d41cec277cf1710af4e62d7d21866673604d5ee..8b56a90bf9031daa1274ab757e3e7d1f1d8e06b5 100644 (file)
@@ -2078,9 +2078,21 @@ components:
                 patch:
                   $ref: '#/components/schemas/PatchEmbedded'
                 previous_delegate:
-                  $ref: '#/components/schemas/UserEmbedded'
+                  title: Previous delegate
+                  type:
+                    - 'null'
+                    - 'object'
+                  oneOf:
+                    - type: 'null'
+                    - $ref: '#/components/schemas/UserEmbedded'
                 current_delegate:
-                  $ref: '#/components/schemas/UserEmbedded'
+                  title: Current delegate
+                  type:
+                    - 'null'
+                    - 'object'
+                  oneOf:
+                    - type: 'null'
+                    - $ref: '#/components/schemas/UserEmbedded'
     EventCheckCreated:
       title: Check create event
       description: |
index ba326fc4b7c530f6b9e1ef2d651ae1ab94260b49..1f92590bd43a2e60901d9936f038d3dbbf6dc8a3 100644 (file)
@@ -1608,9 +1608,21 @@ components:
                 patch:
                   $ref: '#/components/schemas/PatchEmbedded'
                 previous_delegate:
-                  $ref: '#/components/schemas/UserEmbedded'
+                  title: Previous delegate
+                  type:
+                    - 'null'
+                    - 'object'
+                  oneOf:
+                    - type: 'null'
+                    - $ref: '#/components/schemas/UserEmbedded'
                 current_delegate:
-                  $ref: '#/components/schemas/UserEmbedded'
+                  title: Current delegate
+                  type:
+                    - 'null'
+                    - 'object'
+                  oneOf:
+                    - type: 'null'
+                    - $ref: '#/components/schemas/UserEmbedded'
     EventCheckCreated:
       title: Check create event
       description: |
index 8b3245a0000f8689f6bf7204357f25844bb92e35..14b6de283edf7fb7ada503e5a48cc28c656ab6a2 100644 (file)
@@ -1635,9 +1635,21 @@ components:
                 patch:
                   $ref: '#/components/schemas/PatchEmbedded'
                 previous_delegate:
-                  $ref: '#/components/schemas/UserEmbedded'
+                  title: Previous delegate
+                  type:
+                    - 'null'
+                    - 'object'
+                  oneOf:
+                    - type: 'null'
+                    - $ref: '#/components/schemas/UserEmbedded'
                 current_delegate:
-                  $ref: '#/components/schemas/UserEmbedded'
+                  title: Current delegate
+                  type:
+                    - 'null'
+                    - 'object'
+                  oneOf:
+                    - type: 'null'
+                    - $ref: '#/components/schemas/UserEmbedded'
     EventCheckCreated:
       title: Check create event
       description: |
index f4dcb82782a0e33f73fc5c33c2dd3a8b572dc54f..7135a20fc5c5c80af6fc2ffcae6e885082ea77d8 100644 (file)
@@ -1837,9 +1837,21 @@ components:
                 patch:
                   $ref: '#/components/schemas/PatchEmbedded'
                 previous_delegate:
-                  $ref: '#/components/schemas/UserEmbedded'
+                  title: Previous delegate
+                  type:
+                    - 'null'
+                    - 'object'
+                  oneOf:
+                    - type: 'null'
+                    - $ref: '#/components/schemas/UserEmbedded'
                 current_delegate:
-                  $ref: '#/components/schemas/UserEmbedded'
+                  title: Current delegate
+                  type:
+                    - 'null'
+                    - 'object'
+                  oneOf:
+                    - type: 'null'
+                    - $ref: '#/components/schemas/UserEmbedded'
     EventCheckCreated:
       title: Check create event
       description: |
index 1b8b1819e1d1d3b32e4d4934c53fdb74d9a232f9..7ad6129b1f2d76775256c4148b744d1f43589e8a 100644 (file)
@@ -2000,9 +2000,21 @@ components:
                 patch:
                   $ref: '#/components/schemas/PatchEmbedded'
                 previous_delegate:
-                  $ref: '#/components/schemas/UserEmbedded'
+                  title: Previous delegate
+                  type:
+                    - 'null'
+                    - 'object'
+                  oneOf:
+                    - type: 'null'
+                    - $ref: '#/components/schemas/UserEmbedded'
                 current_delegate:
-                  $ref: '#/components/schemas/UserEmbedded'
+                  title: Current delegate
+                  type:
+                    - 'null'
+                    - 'object'
+                  oneOf:
+                    - type: 'null'
+                    - $ref: '#/components/schemas/UserEmbedded'
     EventCheckCreated:
       title: Check create event
       description: |
index f36bdd2d9f5e93bfea7d891ab4c3fd6a155f8ddc..890d449c17dd6f1697661569f4db91d4a0322b5b 100644 (file)
@@ -6,8 +6,6 @@
 from django.test import override_settings
 from django.urls import reverse
 from rest_framework import status
-from rest_framework.test import APITestCase
-
 
 from patchwork.models import Event
 from patchwork.tests.api import utils
@@ -21,10 +19,8 @@ from patchwork.tests.utils import create_series
 from patchwork.tests.utils import create_state
 
 
-# FIXME(stephenfin: This should inherit from 'utils.APITestCase', but we need
-# to fix our schema to work with recent versions of openapi_core
 @override_settings(ENABLE_REST_API=True)
-class TestEventAPI(APITestCase):
+class TestEventAPI(utils.APITestCase):
     @staticmethod
     def api_url(version=None):
         kwargs = {}