diff --git a/docs/api/schemas/latest/patchwork.yaml b/docs/api/schemas/latest/patchwork.yaml index b3de0db5..e3c86722 100644 --- a/docs/api/schemas/latest/patchwork.yaml +++ b/docs/api/schemas/latest/patchwork.yaml @@ -2,7 +2,7 @@ # proposed against the template and updated files generated using the # 'generate-schemas.py' tool --- -openapi: '3.0.0' +openapi: '3.1.0' info: title: Patchwork API description: > @@ -1495,12 +1495,13 @@ components: minLength: 1 maxLength: 50 owner: - type: object title: Owner readOnly: true - nullable: false - allOf: - - $ref: '#/components/schemas/UserEmbedded' + anyOf: + - type: 'null' + - type: object + allOf: + - $ref: '#/components/schemas/UserEmbedded' patches: title: Patches type: array @@ -1567,10 +1568,11 @@ components: description: > The target URL to associate with this check. This should be specific to the patch. - type: string - format: uri - maxLength: 200 - nullable: true + oneOf: + - type: 'null' + - type: string + format: uri + maxLength: 200 context: title: Context description: > @@ -1582,8 +1584,9 @@ components: description: title: Description description: A brief description of the check. - type: string - nullable: true + oneOf: + - type: 'null' + - type: string CheckCreate: type: object required: @@ -1603,10 +1606,11 @@ components: description: The target URL to associate with this check. This should be specific to the patch. - type: string - format: uri - maxLength: 200 - nullable: true + oneOf: + - type: 'null' + - type: string + format: uri + maxLength: 200 context: title: Context description: > @@ -1618,8 +1622,9 @@ components: description: title: Description description: A brief description of the check. - type: string - nullable: true + oneOf: + - type: 'null' + - type: string Comment: type: object properties: @@ -1645,9 +1650,10 @@ components: maxLength: 255 list_archive_url: title: List archive URL - type: string readOnly: true - nullable: true + oneOf: + - type: 'null' + - type: string date: title: Date type: string @@ -1681,15 +1687,17 @@ components: readOnly: true addressed: title: Addressed - type: boolean - nullable: true + oneOf: + - type: 'null' + - type: boolean CommentUpdate: type: object properties: addressed: title: Addressed - type: boolean - nullable: true + oneOf: + - type: 'null' + - type: boolean CoverList: type: object properties: @@ -1717,9 +1725,10 @@ components: maxLength: 255 list_archive_url: title: List archive URL - type: string readOnly: true - nullable: true + oneOf: + - type: 'null' + - type: string date: title: Date type: string @@ -1794,13 +1803,12 @@ components: format: iso8601 readOnly: true actor: - type: object title: Actor description: The user that caused/created this event. readOnly: true - nullable: true - allOf: + anyOf: - $ref: '#/components/schemas/UserEmbedded' + - type: 'null' payload: type: object EventCoverCreated: @@ -1873,12 +1881,14 @@ components: $ref: '#/components/schemas/PatchEmbedded' previous_relation: title: Previous relation - type: string - nullable: true + oneOf: + - type: 'null' + - type: string current_relation: title: Current relation - type: string - nullable: true + oneOf: + - type: 'null' + - type: string EventPatchDelegated: allOf: - $ref: '#/components/schemas/EventBase' @@ -1991,9 +2001,10 @@ components: maxLength: 255 list_archive_url: title: List archive URL - type: string readOnly: true - nullable: true + oneOf: + - type: 'null' + - type: string date: title: Date type: string @@ -2007,15 +2018,17 @@ components: maxLength: 255 commit_ref: title: Commit ref - type: string - maxLength: 255 - nullable: true + oneOf: + - type: 'null' + - type: string + maxLength: 255 pull_url: title: Pull URL - type: string - format: uri - maxLength: 255 - nullable: true + oneOf: + - type: 'null' + - type: string + maxLength: 255 + format: uri state: title: State type: string @@ -2034,12 +2047,11 @@ components: allOf: - $ref: '#/components/schemas/PersonEmbedded' delegate: - type: object title: Delegate - nullable: true readOnly: true - allOf: + anyOf: - $ref: '#/components/schemas/UserEmbedded' + - type: 'null' mbox: title: Mbox type: string @@ -2117,15 +2129,18 @@ components: properties: commit_ref: title: Commit ref - type: string - maxLength: 255 - nullable: true + oneOf: + - type: 'null' + - type: string + maxLength: 255 pull_url: title: Pull URL type: string - format: uri - maxLength: 255 - nullable: true + oneOf: + - type: 'null' + - type: string + maxLength: 255 + format: uri state: title: State type: string @@ -2134,8 +2149,9 @@ components: type: boolean delegate: title: Delegate - type: integer - nullable: true + oneOf: + - type: 'null' + - type: integer related: title: Relations type: array @@ -2167,12 +2183,11 @@ components: minLength: 1 maxLength: 255 user: - type: object title: User - nullable: true readOnly: true - allOf: + anyOf: - $ref: '#/components/schemas/UserEmbedded' + - type: 'null' Project: type: object properties: @@ -2244,19 +2259,21 @@ components: maxLength: 64 list_archive_url: title: List archive URL - type: string - format: uri - maxLength: 2000 - nullable: true + oneOf: + - type: 'null' + - type: string + format: uri + maxLength: 2000 list_archive_url_format: title: List archive URL format - type: string - format: uri - maxLength: 2000 - nullable: true description: > URL format for the list archive's Message-ID redirector. {} will be replaced by the Message-ID. + oneOf: + - type: 'null' + - type: string + format: uri + maxLength: 2000 commit_url_format: title: Web SCM URL format for a particular commit type: string @@ -2284,9 +2301,10 @@ components: description: > An optional name to associate with the series, e.g. "John's PCI series". - type: string - maxLength: 255 - nullable: true + oneOf: + - type: 'null' + - type: string + maxLength: 255 date: title: Date type: string @@ -2422,10 +2440,11 @@ components: description: > The target URL to associate with this check. This should be specific to the patch. - type: string - format: uri - maxLength: 200 - nullable: true + oneOf: + - type: 'null' + - type: string + format: uri + maxLength: 200 readOnly: true context: title: Context @@ -2460,9 +2479,10 @@ components: minLength: 1 list_archive_url: title: List archive URL - type: string readOnly: true - nullable: true + oneOf: + - type: 'null' + - type: string date: title: Date type: string @@ -2497,9 +2517,10 @@ components: minLength: 1 list_archive_url: title: List archive URL - type: string readOnly: true - nullable: true + oneOf: + - type: 'null' + - type: string date: title: Date type: string @@ -2539,9 +2560,10 @@ components: minLength: 1 list_archive_url: title: List archive URL - type: string readOnly: true - nullable: true + oneOf: + - type: 'null' + - type: string date: title: Date type: string @@ -2636,19 +2658,21 @@ components: maxLength: 2000 list_archive_url: title: List archive URL - type: string - format: uri - maxLength: 2000 - nullable: true + oneOf: + - type: 'null' + - type: string + format: uri + maxLength: 2000 list_archive_url_format: title: List archive URL format - type: string - format: uri - maxLength: 2000 - nullable: true description: > URL format for the list archive's Message-ID redirector. {} will be replaced by the Message-ID. + oneOf: + - type: 'null' + - type: string + format: uri + maxLength: 2000 commit_url_format: title: Web SCM URL format for a particular commit type: string @@ -2675,10 +2699,11 @@ components: description: > An optional name to associate with the series, e.g. "John's PCI series". - type: string readOnly: true - maxLength: 255 - nullable: true + oneOf: + - type: 'null' + - type: string + maxLength: 255 date: title: Date type: string @@ -2697,7 +2722,6 @@ 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 68655348..3c8d9385 100644 --- a/docs/api/schemas/patchwork.j2 +++ b/docs/api/schemas/patchwork.j2 @@ -3,7 +3,7 @@ # proposed against the template and updated files generated using the # 'generate-schemas.py' tool --- -openapi: '3.0.0' +openapi: '3.1.0' info: title: Patchwork API description: > @@ -1546,12 +1546,13 @@ components: minLength: 1 maxLength: 50 owner: - type: object title: Owner readOnly: true - nullable: false - allOf: - - $ref: '#/components/schemas/UserEmbedded' + anyOf: + - type: 'null' + - type: object + allOf: + - $ref: '#/components/schemas/UserEmbedded' patches: title: Patches type: array @@ -1623,10 +1624,11 @@ components: description: > The target URL to associate with this check. This should be specific to the patch. - type: string - format: uri - maxLength: 200 - nullable: true + oneOf: + - type: 'null' + - type: string + format: uri + maxLength: 200 context: title: Context description: > @@ -1638,8 +1640,9 @@ components: description: title: Description description: A brief description of the check. - type: string - nullable: true + oneOf: + - type: 'null' + - type: string CheckCreate: type: object required: @@ -1659,10 +1662,11 @@ components: description: The target URL to associate with this check. This should be specific to the patch. - type: string - format: uri - maxLength: 200 - nullable: true + oneOf: + - type: 'null' + - type: string + format: uri + maxLength: 200 context: title: Context description: > @@ -1674,8 +1678,9 @@ components: description: title: Description description: A brief description of the check. - type: string - nullable: true + oneOf: + - type: 'null' + - type: string Comment: type: object properties: @@ -1706,9 +1711,10 @@ components: {% if version >= (1, 2) %} list_archive_url: title: List archive URL - type: string readOnly: true - nullable: true + oneOf: + - type: 'null' + - type: string {% endif %} date: title: Date @@ -1744,15 +1750,17 @@ components: {% if version >= (1, 3) %} addressed: title: Addressed - type: boolean - nullable: true + oneOf: + - type: 'null' + - type: boolean CommentUpdate: type: object properties: addressed: title: Addressed - type: boolean - nullable: true + oneOf: + - type: 'null' + - type: boolean {% endif %} CoverList: type: object @@ -1784,9 +1792,10 @@ components: {% if version >= (1, 2) %} list_archive_url: title: List archive URL - type: string readOnly: true - nullable: true + oneOf: + - type: 'null' + - type: string {% endif %} date: title: Date @@ -1867,13 +1876,12 @@ components: readOnly: true {% if version >= (1, 2) %} actor: - type: object title: Actor description: The user that caused/created this event. readOnly: true - nullable: true - allOf: + anyOf: - $ref: '#/components/schemas/UserEmbedded' + - type: 'null' {% endif %} payload: type: object @@ -1947,12 +1955,14 @@ components: $ref: '#/components/schemas/PatchEmbedded' previous_relation: title: Previous relation - type: string - nullable: true + oneOf: + - type: 'null' + - type: string current_relation: title: Current relation - type: string - nullable: true + oneOf: + - type: 'null' + - type: string EventPatchDelegated: allOf: - $ref: '#/components/schemas/EventBase' @@ -2068,9 +2078,10 @@ components: {% if version >= (1, 2) %} list_archive_url: title: List archive URL - type: string readOnly: true - nullable: true + oneOf: + - type: 'null' + - type: string {% endif %} date: title: Date @@ -2085,15 +2096,17 @@ components: maxLength: 255 commit_ref: title: Commit ref - type: string - maxLength: 255 - nullable: true + oneOf: + - type: 'null' + - type: string + maxLength: 255 pull_url: title: Pull URL - type: string - format: uri - maxLength: 255 - nullable: true + oneOf: + - type: 'null' + - type: string + maxLength: 255 + format: uri state: title: State type: string @@ -2112,12 +2125,11 @@ components: allOf: - $ref: '#/components/schemas/PersonEmbedded' delegate: - type: object title: Delegate - nullable: true readOnly: true - allOf: + anyOf: - $ref: '#/components/schemas/UserEmbedded' + - type: 'null' mbox: title: Mbox type: string @@ -2199,15 +2211,18 @@ components: properties: commit_ref: title: Commit ref - type: string - maxLength: 255 - nullable: true + oneOf: + - type: 'null' + - type: string + maxLength: 255 pull_url: title: Pull URL type: string - format: uri - maxLength: 255 - nullable: true + oneOf: + - type: 'null' + - type: string + maxLength: 255 + format: uri state: title: State type: string @@ -2216,8 +2231,9 @@ components: type: boolean delegate: title: Delegate - type: integer - nullable: true + oneOf: + - type: 'null' + - type: integer {% if version >= (1, 2) %} related: title: Relations @@ -2251,12 +2267,11 @@ components: minLength: 1 maxLength: 255 user: - type: object title: User - nullable: true readOnly: true - allOf: + anyOf: - $ref: '#/components/schemas/UserEmbedded' + - type: 'null' Project: type: object properties: @@ -2331,19 +2346,21 @@ components: {% if version >= (1, 2) %} list_archive_url: title: List archive URL - type: string - format: uri - maxLength: 2000 - nullable: true + oneOf: + - type: 'null' + - type: string + format: uri + maxLength: 2000 list_archive_url_format: title: List archive URL format - type: string - format: uri - maxLength: 2000 - nullable: true description: > URL format for the list archive's Message-ID redirector. {} will be replaced by the Message-ID. + oneOf: + - type: 'null' + - type: string + format: uri + maxLength: 2000 commit_url_format: title: Web SCM URL format for a particular commit type: string @@ -2374,9 +2391,10 @@ components: description: > An optional name to associate with the series, e.g. "John's PCI series". - type: string - maxLength: 255 - nullable: true + oneOf: + - type: 'null' + - type: string + maxLength: 255 date: title: Date type: string @@ -2514,10 +2532,11 @@ components: description: > The target URL to associate with this check. This should be specific to the patch. - type: string - format: uri - maxLength: 200 - nullable: true + oneOf: + - type: 'null' + - type: string + format: uri + maxLength: 200 readOnly: true context: title: Context @@ -2557,9 +2576,10 @@ components: {% if version >= (1, 2) %} list_archive_url: title: List archive URL - type: string readOnly: true - nullable: true + oneOf: + - type: 'null' + - type: string {% endif %} date: title: Date @@ -2598,9 +2618,10 @@ components: {% if version >= (1, 2) %} list_archive_url: title: List archive URL - type: string readOnly: true - nullable: true + oneOf: + - type: 'null' + - type: string {% endif %} date: title: Date @@ -2644,9 +2665,10 @@ components: {% if version >= (1, 2) %} list_archive_url: title: List archive URL - type: string readOnly: true - nullable: true + oneOf: + - type: 'null' + - type: string {% endif %} date: title: Date @@ -2743,19 +2765,21 @@ components: {% if version >= (1, 2) %} list_archive_url: title: List archive URL - type: string - format: uri - maxLength: 2000 - nullable: true + oneOf: + - type: 'null' + - type: string + format: uri + maxLength: 2000 list_archive_url_format: title: List archive URL format - type: string - format: uri - maxLength: 2000 - nullable: true description: > URL format for the list archive's Message-ID redirector. {} will be replaced by the Message-ID. + oneOf: + - type: 'null' + - type: string + format: uri + maxLength: 2000 commit_url_format: title: Web SCM URL format for a particular commit type: string @@ -2785,10 +2809,11 @@ components: description: > An optional name to associate with the series, e.g. "John's PCI series". - type: string readOnly: true - maxLength: 255 - nullable: true + oneOf: + - type: 'null' + - type: string + maxLength: 255 date: title: Date type: string @@ -2807,7 +2832,6 @@ 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 6c3893ec..da8dc3d1 100644 --- a/docs/api/schemas/v1.0/patchwork.yaml +++ b/docs/api/schemas/v1.0/patchwork.yaml @@ -2,7 +2,7 @@ # proposed against the template and updated files generated using the # 'generate-schemas.py' tool --- -openapi: '3.0.0' +openapi: '3.1.0' info: title: Patchwork API description: > @@ -1203,12 +1203,13 @@ components: minLength: 1 maxLength: 50 owner: - type: object title: Owner readOnly: true - nullable: false - allOf: - - $ref: '#/components/schemas/UserEmbedded' + anyOf: + - type: 'null' + - type: object + allOf: + - $ref: '#/components/schemas/UserEmbedded' patches: title: Patches type: array @@ -1257,10 +1258,11 @@ components: description: > The target URL to associate with this check. This should be specific to the patch. - type: string - format: uri - maxLength: 200 - nullable: true + oneOf: + - type: 'null' + - type: string + format: uri + maxLength: 200 context: title: Context description: > @@ -1272,8 +1274,9 @@ components: description: title: Description description: A brief description of the check. - type: string - nullable: true + oneOf: + - type: 'null' + - type: string CheckCreate: type: object required: @@ -1293,10 +1296,11 @@ components: description: The target URL to associate with this check. This should be specific to the patch. - type: string - format: uri - maxLength: 200 - nullable: true + oneOf: + - type: 'null' + - type: string + format: uri + maxLength: 200 context: title: Context description: > @@ -1308,8 +1312,9 @@ components: description: title: Description description: A brief description of the check. - type: string - nullable: true + oneOf: + - type: 'null' + - type: string Comment: type: object properties: @@ -1509,12 +1514,14 @@ components: $ref: '#/components/schemas/PatchEmbedded' previous_relation: title: Previous relation - type: string - nullable: true + oneOf: + - type: 'null' + - type: string current_relation: title: Current relation - type: string - nullable: true + oneOf: + - type: 'null' + - type: string EventPatchDelegated: allOf: - $ref: '#/components/schemas/EventBase' @@ -1633,15 +1640,17 @@ components: maxLength: 255 commit_ref: title: Commit ref - type: string - maxLength: 255 - nullable: true + oneOf: + - type: 'null' + - type: string + maxLength: 255 pull_url: title: Pull URL - type: string - format: uri - maxLength: 255 - nullable: true + oneOf: + - type: 'null' + - type: string + maxLength: 255 + format: uri state: title: State type: string @@ -1660,12 +1669,11 @@ components: allOf: - $ref: '#/components/schemas/PersonEmbedded' delegate: - type: object title: Delegate - nullable: true readOnly: true - allOf: + anyOf: - $ref: '#/components/schemas/UserEmbedded' + - type: 'null' mbox: title: Mbox type: string @@ -1733,15 +1741,18 @@ components: properties: commit_ref: title: Commit ref - type: string - maxLength: 255 - nullable: true + oneOf: + - type: 'null' + - type: string + maxLength: 255 pull_url: title: Pull URL type: string - format: uri - maxLength: 255 - nullable: true + oneOf: + - type: 'null' + - type: string + maxLength: 255 + format: uri state: title: State type: string @@ -1750,8 +1761,9 @@ components: type: boolean delegate: title: Delegate - type: integer - nullable: true + oneOf: + - type: 'null' + - type: integer Person: type: object properties: @@ -1778,12 +1790,11 @@ components: minLength: 1 maxLength: 255 user: - type: object title: User - nullable: true readOnly: true - allOf: + anyOf: - $ref: '#/components/schemas/UserEmbedded' + - type: 'null' Project: type: object properties: @@ -1861,9 +1872,10 @@ components: description: > An optional name to associate with the series, e.g. "John's PCI series". - type: string - maxLength: 255 - nullable: true + oneOf: + - type: 'null' + - type: string + maxLength: 255 date: title: Date type: string @@ -1972,10 +1984,11 @@ components: description: > The target URL to associate with this check. This should be specific to the patch. - type: string - format: uri - maxLength: 200 - nullable: true + oneOf: + - type: 'null' + - type: string + format: uri + maxLength: 200 readOnly: true context: title: Context @@ -2166,10 +2179,11 @@ components: description: > An optional name to associate with the series, e.g. "John's PCI series". - type: string readOnly: true - maxLength: 255 - nullable: true + oneOf: + - type: 'null' + - type: string + maxLength: 255 date: title: Date type: string @@ -2188,7 +2202,6 @@ 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 7e2299c5..2837f664 100644 --- a/docs/api/schemas/v1.1/patchwork.yaml +++ b/docs/api/schemas/v1.1/patchwork.yaml @@ -2,7 +2,7 @@ # proposed against the template and updated files generated using the # 'generate-schemas.py' tool --- -openapi: '3.0.0' +openapi: '3.1.0' info: title: Patchwork API description: > @@ -1208,12 +1208,13 @@ components: minLength: 1 maxLength: 50 owner: - type: object title: Owner readOnly: true - nullable: false - allOf: - - $ref: '#/components/schemas/UserEmbedded' + anyOf: + - type: 'null' + - type: object + allOf: + - $ref: '#/components/schemas/UserEmbedded' patches: title: Patches type: array @@ -1262,10 +1263,11 @@ components: description: > The target URL to associate with this check. This should be specific to the patch. - type: string - format: uri - maxLength: 200 - nullable: true + oneOf: + - type: 'null' + - type: string + format: uri + maxLength: 200 context: title: Context description: > @@ -1277,8 +1279,9 @@ components: description: title: Description description: A brief description of the check. - type: string - nullable: true + oneOf: + - type: 'null' + - type: string CheckCreate: type: object required: @@ -1298,10 +1301,11 @@ components: description: The target URL to associate with this check. This should be specific to the patch. - type: string - format: uri - maxLength: 200 - nullable: true + oneOf: + - type: 'null' + - type: string + format: uri + maxLength: 200 context: title: Context description: > @@ -1313,8 +1317,9 @@ components: description: title: Description description: A brief description of the check. - type: string - nullable: true + oneOf: + - type: 'null' + - type: string Comment: type: object properties: @@ -1534,12 +1539,14 @@ components: $ref: '#/components/schemas/PatchEmbedded' previous_relation: title: Previous relation - type: string - nullable: true + oneOf: + - type: 'null' + - type: string current_relation: title: Current relation - type: string - nullable: true + oneOf: + - type: 'null' + - type: string EventPatchDelegated: allOf: - $ref: '#/components/schemas/EventBase' @@ -1663,15 +1670,17 @@ components: maxLength: 255 commit_ref: title: Commit ref - type: string - maxLength: 255 - nullable: true + oneOf: + - type: 'null' + - type: string + maxLength: 255 pull_url: title: Pull URL - type: string - format: uri - maxLength: 255 - nullable: true + oneOf: + - type: 'null' + - type: string + maxLength: 255 + format: uri state: title: State type: string @@ -1690,12 +1699,11 @@ components: allOf: - $ref: '#/components/schemas/PersonEmbedded' delegate: - type: object title: Delegate - nullable: true readOnly: true - allOf: + anyOf: - $ref: '#/components/schemas/UserEmbedded' + - type: 'null' mbox: title: Mbox type: string @@ -1768,15 +1776,18 @@ components: properties: commit_ref: title: Commit ref - type: string - maxLength: 255 - nullable: true + oneOf: + - type: 'null' + - type: string + maxLength: 255 pull_url: title: Pull URL type: string - format: uri - maxLength: 255 - nullable: true + oneOf: + - type: 'null' + - type: string + maxLength: 255 + format: uri state: title: State type: string @@ -1785,8 +1796,9 @@ components: type: boolean delegate: title: Delegate - type: integer - nullable: true + oneOf: + - type: 'null' + - type: integer Person: type: object properties: @@ -1813,12 +1825,11 @@ components: minLength: 1 maxLength: 255 user: - type: object title: User - nullable: true readOnly: true - allOf: + anyOf: - $ref: '#/components/schemas/UserEmbedded' + - type: 'null' Project: type: object properties: @@ -1912,9 +1923,10 @@ components: description: > An optional name to associate with the series, e.g. "John's PCI series". - type: string - maxLength: 255 - nullable: true + oneOf: + - type: 'null' + - type: string + maxLength: 255 date: title: Date type: string @@ -2023,10 +2035,11 @@ components: description: > The target URL to associate with this check. This should be specific to the patch. - type: string - format: uri - maxLength: 200 - nullable: true + oneOf: + - type: 'null' + - type: string + format: uri + maxLength: 200 readOnly: true context: title: Context @@ -2237,10 +2250,11 @@ components: description: > An optional name to associate with the series, e.g. "John's PCI series". - type: string readOnly: true - maxLength: 255 - nullable: true + oneOf: + - type: 'null' + - type: string + maxLength: 255 date: title: Date type: string @@ -2259,7 +2273,6 @@ 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 93c3e97e..3d6fbcee 100644 --- a/docs/api/schemas/v1.2/patchwork.yaml +++ b/docs/api/schemas/v1.2/patchwork.yaml @@ -2,7 +2,7 @@ # proposed against the template and updated files generated using the # 'generate-schemas.py' tool --- -openapi: '3.0.0' +openapi: '3.1.0' info: title: Patchwork API description: > @@ -1355,12 +1355,13 @@ components: minLength: 1 maxLength: 50 owner: - type: object title: Owner readOnly: true - nullable: false - allOf: - - $ref: '#/components/schemas/UserEmbedded' + anyOf: + - type: 'null' + - type: object + allOf: + - $ref: '#/components/schemas/UserEmbedded' patches: title: Patches type: array @@ -1427,10 +1428,11 @@ components: description: > The target URL to associate with this check. This should be specific to the patch. - type: string - format: uri - maxLength: 200 - nullable: true + oneOf: + - type: 'null' + - type: string + format: uri + maxLength: 200 context: title: Context description: > @@ -1442,8 +1444,9 @@ components: description: title: Description description: A brief description of the check. - type: string - nullable: true + oneOf: + - type: 'null' + - type: string CheckCreate: type: object required: @@ -1463,10 +1466,11 @@ components: description: The target URL to associate with this check. This should be specific to the patch. - type: string - format: uri - maxLength: 200 - nullable: true + oneOf: + - type: 'null' + - type: string + format: uri + maxLength: 200 context: title: Context description: > @@ -1478,8 +1482,9 @@ components: description: title: Description description: A brief description of the check. - type: string - nullable: true + oneOf: + - type: 'null' + - type: string Comment: type: object properties: @@ -1500,9 +1505,10 @@ components: maxLength: 255 list_archive_url: title: List archive URL - type: string readOnly: true - nullable: true + oneOf: + - type: 'null' + - type: string date: title: Date type: string @@ -1561,9 +1567,10 @@ components: maxLength: 255 list_archive_url: title: List archive URL - type: string readOnly: true - nullable: true + oneOf: + - type: 'null' + - type: string date: title: Date type: string @@ -1638,13 +1645,12 @@ components: format: iso8601 readOnly: true actor: - type: object title: Actor description: The user that caused/created this event. readOnly: true - nullable: true - allOf: + anyOf: - $ref: '#/components/schemas/UserEmbedded' + - type: 'null' payload: type: object EventCoverCreated: @@ -1717,12 +1723,14 @@ components: $ref: '#/components/schemas/PatchEmbedded' previous_relation: title: Previous relation - type: string - nullable: true + oneOf: + - type: 'null' + - type: string current_relation: title: Current relation - type: string - nullable: true + oneOf: + - type: 'null' + - type: string EventPatchDelegated: allOf: - $ref: '#/components/schemas/EventBase' @@ -1835,9 +1843,10 @@ components: maxLength: 255 list_archive_url: title: List archive URL - type: string readOnly: true - nullable: true + oneOf: + - type: 'null' + - type: string date: title: Date type: string @@ -1851,15 +1860,17 @@ components: maxLength: 255 commit_ref: title: Commit ref - type: string - maxLength: 255 - nullable: true + oneOf: + - type: 'null' + - type: string + maxLength: 255 pull_url: title: Pull URL - type: string - format: uri - maxLength: 255 - nullable: true + oneOf: + - type: 'null' + - type: string + maxLength: 255 + format: uri state: title: State type: string @@ -1878,12 +1889,11 @@ components: allOf: - $ref: '#/components/schemas/PersonEmbedded' delegate: - type: object title: Delegate - nullable: true readOnly: true - allOf: + anyOf: - $ref: '#/components/schemas/UserEmbedded' + - type: 'null' mbox: title: Mbox type: string @@ -1961,15 +1971,18 @@ components: properties: commit_ref: title: Commit ref - type: string - maxLength: 255 - nullable: true + oneOf: + - type: 'null' + - type: string + maxLength: 255 pull_url: title: Pull URL type: string - format: uri - maxLength: 255 - nullable: true + oneOf: + - type: 'null' + - type: string + maxLength: 255 + format: uri state: title: State type: string @@ -1978,8 +1991,9 @@ components: type: boolean delegate: title: Delegate - type: integer - nullable: true + oneOf: + - type: 'null' + - type: integer related: title: Relations type: array @@ -2011,12 +2025,11 @@ components: minLength: 1 maxLength: 255 user: - type: object title: User - nullable: true readOnly: true - allOf: + anyOf: - $ref: '#/components/schemas/UserEmbedded' + - type: 'null' Project: type: object properties: @@ -2088,19 +2101,21 @@ components: maxLength: 64 list_archive_url: title: List archive URL - type: string - format: uri - maxLength: 2000 - nullable: true + oneOf: + - type: 'null' + - type: string + format: uri + maxLength: 2000 list_archive_url_format: title: List archive URL format - type: string - format: uri - maxLength: 2000 - nullable: true description: > URL format for the list archive's Message-ID redirector. {} will be replaced by the Message-ID. + oneOf: + - type: 'null' + - type: string + format: uri + maxLength: 2000 commit_url_format: title: Web SCM URL format for a particular commit type: string @@ -2128,9 +2143,10 @@ components: description: > An optional name to associate with the series, e.g. "John's PCI series". - type: string - maxLength: 255 - nullable: true + oneOf: + - type: 'null' + - type: string + maxLength: 255 date: title: Date type: string @@ -2266,10 +2282,11 @@ components: description: > The target URL to associate with this check. This should be specific to the patch. - type: string - format: uri - maxLength: 200 - nullable: true + oneOf: + - type: 'null' + - type: string + format: uri + maxLength: 200 readOnly: true context: title: Context @@ -2299,9 +2316,10 @@ components: minLength: 1 list_archive_url: title: List archive URL - type: string readOnly: true - nullable: true + oneOf: + - type: 'null' + - type: string date: title: Date type: string @@ -2336,9 +2354,10 @@ components: minLength: 1 list_archive_url: title: List archive URL - type: string readOnly: true - nullable: true + oneOf: + - type: 'null' + - type: string date: title: Date type: string @@ -2378,9 +2397,10 @@ components: minLength: 1 list_archive_url: title: List archive URL - type: string readOnly: true - nullable: true + oneOf: + - type: 'null' + - type: string date: title: Date type: string @@ -2475,19 +2495,21 @@ components: maxLength: 2000 list_archive_url: title: List archive URL - type: string - format: uri - maxLength: 2000 - nullable: true + oneOf: + - type: 'null' + - type: string + format: uri + maxLength: 2000 list_archive_url_format: title: List archive URL format - type: string - format: uri - maxLength: 2000 - nullable: true description: > URL format for the list archive's Message-ID redirector. {} will be replaced by the Message-ID. + oneOf: + - type: 'null' + - type: string + format: uri + maxLength: 2000 commit_url_format: title: Web SCM URL format for a particular commit type: string @@ -2514,10 +2536,11 @@ components: description: > An optional name to associate with the series, e.g. "John's PCI series". - type: string readOnly: true - maxLength: 255 - nullable: true + oneOf: + - type: 'null' + - type: string + maxLength: 255 date: title: Date type: string @@ -2536,7 +2559,6 @@ components: readOnly: true UserEmbedded: type: object - nullable: true properties: id: title: ID diff --git a/docs/api/schemas/v1.3/patchwork.yaml b/docs/api/schemas/v1.3/patchwork.yaml index 8663406d..0755573a 100644 --- a/docs/api/schemas/v1.3/patchwork.yaml +++ b/docs/api/schemas/v1.3/patchwork.yaml @@ -2,7 +2,7 @@ # proposed against the template and updated files generated using the # 'generate-schemas.py' tool --- -openapi: '3.0.0' +openapi: '3.1.0' info: title: Patchwork API description: > @@ -1495,12 +1495,13 @@ components: minLength: 1 maxLength: 50 owner: - type: object title: Owner readOnly: true - nullable: false - allOf: - - $ref: '#/components/schemas/UserEmbedded' + anyOf: + - type: 'null' + - type: object + allOf: + - $ref: '#/components/schemas/UserEmbedded' patches: title: Patches type: array @@ -1567,10 +1568,11 @@ components: description: > The target URL to associate with this check. This should be specific to the patch. - type: string - format: uri - maxLength: 200 - nullable: true + oneOf: + - type: 'null' + - type: string + format: uri + maxLength: 200 context: title: Context description: > @@ -1582,8 +1584,9 @@ components: description: title: Description description: A brief description of the check. - type: string - nullable: true + oneOf: + - type: 'null' + - type: string CheckCreate: type: object required: @@ -1603,10 +1606,11 @@ components: description: The target URL to associate with this check. This should be specific to the patch. - type: string - format: uri - maxLength: 200 - nullable: true + oneOf: + - type: 'null' + - type: string + format: uri + maxLength: 200 context: title: Context description: > @@ -1618,8 +1622,9 @@ components: description: title: Description description: A brief description of the check. - type: string - nullable: true + oneOf: + - type: 'null' + - type: string Comment: type: object properties: @@ -1645,9 +1650,10 @@ components: maxLength: 255 list_archive_url: title: List archive URL - type: string readOnly: true - nullable: true + oneOf: + - type: 'null' + - type: string date: title: Date type: string @@ -1681,15 +1687,17 @@ components: readOnly: true addressed: title: Addressed - type: boolean - nullable: true + oneOf: + - type: 'null' + - type: boolean CommentUpdate: type: object properties: addressed: title: Addressed - type: boolean - nullable: true + oneOf: + - type: 'null' + - type: boolean CoverList: type: object properties: @@ -1717,9 +1725,10 @@ components: maxLength: 255 list_archive_url: title: List archive URL - type: string readOnly: true - nullable: true + oneOf: + - type: 'null' + - type: string date: title: Date type: string @@ -1794,13 +1803,12 @@ components: format: iso8601 readOnly: true actor: - type: object title: Actor description: The user that caused/created this event. readOnly: true - nullable: true - allOf: + anyOf: - $ref: '#/components/schemas/UserEmbedded' + - type: 'null' payload: type: object EventCoverCreated: @@ -1873,12 +1881,14 @@ components: $ref: '#/components/schemas/PatchEmbedded' previous_relation: title: Previous relation - type: string - nullable: true + oneOf: + - type: 'null' + - type: string current_relation: title: Current relation - type: string - nullable: true + oneOf: + - type: 'null' + - type: string EventPatchDelegated: allOf: - $ref: '#/components/schemas/EventBase' @@ -1991,9 +2001,10 @@ components: maxLength: 255 list_archive_url: title: List archive URL - type: string readOnly: true - nullable: true + oneOf: + - type: 'null' + - type: string date: title: Date type: string @@ -2007,15 +2018,17 @@ components: maxLength: 255 commit_ref: title: Commit ref - type: string - maxLength: 255 - nullable: true + oneOf: + - type: 'null' + - type: string + maxLength: 255 pull_url: title: Pull URL - type: string - format: uri - maxLength: 255 - nullable: true + oneOf: + - type: 'null' + - type: string + maxLength: 255 + format: uri state: title: State type: string @@ -2034,12 +2047,11 @@ components: allOf: - $ref: '#/components/schemas/PersonEmbedded' delegate: - type: object title: Delegate - nullable: true readOnly: true - allOf: + anyOf: - $ref: '#/components/schemas/UserEmbedded' + - type: 'null' mbox: title: Mbox type: string @@ -2117,15 +2129,18 @@ components: properties: commit_ref: title: Commit ref - type: string - maxLength: 255 - nullable: true + oneOf: + - type: 'null' + - type: string + maxLength: 255 pull_url: title: Pull URL type: string - format: uri - maxLength: 255 - nullable: true + oneOf: + - type: 'null' + - type: string + maxLength: 255 + format: uri state: title: State type: string @@ -2134,8 +2149,9 @@ components: type: boolean delegate: title: Delegate - type: integer - nullable: true + oneOf: + - type: 'null' + - type: integer related: title: Relations type: array @@ -2167,12 +2183,11 @@ components: minLength: 1 maxLength: 255 user: - type: object title: User - nullable: true readOnly: true - allOf: + anyOf: - $ref: '#/components/schemas/UserEmbedded' + - type: 'null' Project: type: object properties: @@ -2244,19 +2259,21 @@ components: maxLength: 64 list_archive_url: title: List archive URL - type: string - format: uri - maxLength: 2000 - nullable: true + oneOf: + - type: 'null' + - type: string + format: uri + maxLength: 2000 list_archive_url_format: title: List archive URL format - type: string - format: uri - maxLength: 2000 - nullable: true description: > URL format for the list archive's Message-ID redirector. {} will be replaced by the Message-ID. + oneOf: + - type: 'null' + - type: string + format: uri + maxLength: 2000 commit_url_format: title: Web SCM URL format for a particular commit type: string @@ -2284,9 +2301,10 @@ components: description: > An optional name to associate with the series, e.g. "John's PCI series". - type: string - maxLength: 255 - nullable: true + oneOf: + - type: 'null' + - type: string + maxLength: 255 date: title: Date type: string @@ -2422,10 +2440,11 @@ components: description: > The target URL to associate with this check. This should be specific to the patch. - type: string - format: uri - maxLength: 200 - nullable: true + oneOf: + - type: 'null' + - type: string + format: uri + maxLength: 200 readOnly: true context: title: Context @@ -2460,9 +2479,10 @@ components: minLength: 1 list_archive_url: title: List archive URL - type: string readOnly: true - nullable: true + oneOf: + - type: 'null' + - type: string date: title: Date type: string @@ -2497,9 +2517,10 @@ components: minLength: 1 list_archive_url: title: List archive URL - type: string readOnly: true - nullable: true + oneOf: + - type: 'null' + - type: string date: title: Date type: string @@ -2539,9 +2560,10 @@ components: minLength: 1 list_archive_url: title: List archive URL - type: string readOnly: true - nullable: true + oneOf: + - type: 'null' + - type: string date: title: Date type: string @@ -2636,19 +2658,21 @@ components: maxLength: 2000 list_archive_url: title: List archive URL - type: string - format: uri - maxLength: 2000 - nullable: true + oneOf: + - type: 'null' + - type: string + format: uri + maxLength: 2000 list_archive_url_format: title: List archive URL format - type: string - format: uri - maxLength: 2000 - nullable: true description: > URL format for the list archive's Message-ID redirector. {} will be replaced by the Message-ID. + oneOf: + - type: 'null' + - type: string + format: uri + maxLength: 2000 commit_url_format: title: Web SCM URL format for a particular commit type: string @@ -2675,10 +2699,11 @@ components: description: > An optional name to associate with the series, e.g. "John's PCI series". - type: string readOnly: true - maxLength: 255 - nullable: true + oneOf: + - type: 'null' + - type: string + maxLength: 255 date: title: Date type: string @@ -2697,7 +2722,6 @@ components: readOnly: true UserEmbedded: type: object - nullable: true properties: id: title: ID diff --git a/patchwork/tests/api/validator.py b/patchwork/tests/api/validator.py index 35575461..3d4d0195 100644 --- a/patchwork/tests/api/validator.py +++ b/patchwork/tests/api/validator.py @@ -18,7 +18,7 @@ from openapi_core.unmarshalling.schemas.formatters import Formatter from openapi_core.validation.request.validators import RequestValidator from openapi_core.validation.response.validators import ResponseValidator -from openapi_schema_validator import OAS30Validator +from openapi_schema_validator import OAS31Validator from rest_framework import status import yaml @@ -118,7 +118,7 @@ def validate_data( response = DjangoOpenAPIResponse(response) schema_unmarshallers_factory = SchemaUnmarshallersFactory( - OAS30Validator, + OAS31Validator, custom_formatters=CUSTOM_FORMATTERS, # context=UnmarshalContext.RESPONSE, )