]> git.ipfire.org Git - thirdparty/patchwork.git/commitdiff
docs: Make embedded fields nullable by default
authorStephen Finucane <stephen@that.guru>
Wed, 15 Apr 2020 22:37:17 +0000 (23:37 +0100)
committerStephen Finucane <stephen@that.guru>
Sat, 18 Apr 2020 10:57:28 +0000 (11:57 +0100)
As discussed at [1], "subtypes can add restrictions, but they cannot
relax restrictions that are already in place." These fields need to be
marked nullable and then "subclassed" to set non-nullability if
required.

[1] https://github.com/OAI/OpenAPI-Specification/issues/1368

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

index cc0d97e696b655f7c27b3034c5d52e8e57ee5361..c4928a7f4ea7c534395a0d3908c6a60e048502e3 100644 (file)
@@ -1420,6 +1420,7 @@ components:
           type: object
           title: Owner
           readOnly: true
+          nullable: false
           allOf:
             - $ref: '#/components/schemas/UserEmbedded'
         patches:
@@ -2522,6 +2523,7 @@ components:
           readOnly: true
     UserEmbedded:
       type: object
+      nullable: true
       properties:
         id:
           title: ID
index f5618d41faa05f6a0d6373e92c116c29dc1dc939..54910084310cc5c7d45d61d920561525b5055149 100644 (file)
@@ -1469,6 +1469,7 @@ components:
           type: object
           title: Owner
           readOnly: true
+          nullable: false
           allOf:
             - $ref: '#/components/schemas/UserEmbedded'
         patches:
@@ -2622,6 +2623,7 @@ components:
           readOnly: true
     UserEmbedded:
       type: object
+      nullable: true
       properties:
         id:
           title: ID
index 6c7c068aeb76dcb28916ea2bc4029e113d3b28bb..5622e87ebe7f0ff3afa69e0762bf7d68b8972719 100644 (file)
@@ -1248,6 +1248,7 @@ components:
           type: object
           title: Owner
           readOnly: true
+          nullable: false
           allOf:
             - $ref: '#/components/schemas/UserEmbedded'
         patches:
@@ -2147,6 +2148,7 @@ components:
           readOnly: true
     UserEmbedded:
       type: object
+      nullable: true
       properties:
         id:
           title: ID
index 6b497abaf24421c5e19927e000f27c4dd3171c60..43034fa9f10fe68c7440ab0cec236b517e8c6415 100644 (file)
@@ -1253,6 +1253,7 @@ components:
           type: object
           title: Owner
           readOnly: true
+          nullable: false
           allOf:
             - $ref: '#/components/schemas/UserEmbedded'
         patches:
@@ -2231,6 +2232,7 @@ components:
           readOnly: true
     UserEmbedded:
       type: object
+      nullable: true
       properties:
         id:
           title: ID
index 7bdbe66997c01d392cea57039074f8443c6f3df4..3b441dbb5a1a9b3778c1339de2c7aa60f1051e69 100644 (file)
@@ -1420,6 +1420,7 @@ components:
           type: object
           title: Owner
           readOnly: true
+          nullable: false
           allOf:
             - $ref: '#/components/schemas/UserEmbedded'
         patches:
@@ -2522,6 +2523,7 @@ components:
           readOnly: true
     UserEmbedded:
       type: object
+      nullable: true
       properties:
         id:
           title: ID