From b4d77239c20f788fe65d71953b2889ebfa105397 Mon Sep 17 00:00:00 2001 From: Stephen Finucane Date: Wed, 15 Apr 2020 23:37:17 +0100 Subject: docs: Make embedded fields nullable by default 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 --- docs/api/schemas/latest/patchwork.yaml | 2 ++ docs/api/schemas/patchwork.j2 | 2 ++ docs/api/schemas/v1.0/patchwork.yaml | 2 ++ docs/api/schemas/v1.1/patchwork.yaml | 2 ++ docs/api/schemas/v1.2/patchwork.yaml | 2 ++ 5 files changed, 10 insertions(+) diff --git a/docs/api/schemas/latest/patchwork.yaml b/docs/api/schemas/latest/patchwork.yaml index cc0d97e..c4928a7 100644 --- a/docs/api/schemas/latest/patchwork.yaml +++ b/docs/api/schemas/latest/patchwork.yaml @@ -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 diff --git a/docs/api/schemas/patchwork.j2 b/docs/api/schemas/patchwork.j2 index f5618d4..5491008 100644 --- a/docs/api/schemas/patchwork.j2 +++ b/docs/api/schemas/patchwork.j2 @@ -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 diff --git a/docs/api/schemas/v1.0/patchwork.yaml b/docs/api/schemas/v1.0/patchwork.yaml index 6c7c068..5622e87 100644 --- a/docs/api/schemas/v1.0/patchwork.yaml +++ b/docs/api/schemas/v1.0/patchwork.yaml @@ -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 diff --git a/docs/api/schemas/v1.1/patchwork.yaml b/docs/api/schemas/v1.1/patchwork.yaml index 6b497ab..43034fa 100644 --- a/docs/api/schemas/v1.1/patchwork.yaml +++ b/docs/api/schemas/v1.1/patchwork.yaml @@ -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 diff --git a/docs/api/schemas/v1.2/patchwork.yaml b/docs/api/schemas/v1.2/patchwork.yaml index 7bdbe66..3b441db 100644 --- a/docs/api/schemas/v1.2/patchwork.yaml +++ b/docs/api/schemas/v1.2/patchwork.yaml @@ -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 -- cgit v1.2.3