From 4b47f8e48f1ee27d6f2aa5da8f01dceeff96c6aa Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Tue, 4 Jul 2023 07:21:48 +0100 Subject: [PATCH] Bug 23336: (follow-up) Add checkout_availability schema At some point in the patch series we lost the availability api schema. This patch restores a basic version, but we should work towards a clearer enum based schema for each of the available blockers, confirms and warnings. Signed-off-by: Tomas Cohen Arazi --- .../definitions/checkout_availability.yaml | 18 ++++++++++++++++++ api/v1/swagger/paths/checkouts.yaml | 2 +- api/v1/swagger/swagger.yaml | 2 ++ 3 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 api/v1/swagger/definitions/checkout_availability.yaml diff --git a/api/v1/swagger/definitions/checkout_availability.yaml b/api/v1/swagger/definitions/checkout_availability.yaml new file mode 100644 index 0000000000..3205eee09a --- /dev/null +++ b/api/v1/swagger/definitions/checkout_availability.yaml @@ -0,0 +1,18 @@ +--- +type: object +properties: + blockers: + type: object + description: blocking issues + confirms: + type: object + description: issues requireing confirmation + warnings: + type: object + description: informational issues + confirmation_token: + type: + - string + - "null" + description: token for confirmation +additionalProperties: false diff --git a/api/v1/swagger/paths/checkouts.yaml b/api/v1/swagger/paths/checkouts.yaml index 07aec90dc7..fb448061f3 100644 --- a/api/v1/swagger/paths/checkouts.yaml +++ b/api/v1/swagger/paths/checkouts.yaml @@ -350,7 +350,7 @@ "200": description: Availability schema: - type: "object" + $ref: "../swagger.yaml#/definitions/checkout_availability" "403": description: Access forbidden schema: diff --git a/api/v1/swagger/swagger.yaml b/api/v1/swagger/swagger.yaml index 07f27fd0d4..3e248299ea 100644 --- a/api/v1/swagger/swagger.yaml +++ b/api/v1/swagger/swagger.yaml @@ -26,6 +26,8 @@ definitions: $ref: ./definitions/checkout.yaml checkouts: $ref: ./definitions/checkouts.yaml + checkout_availability: + $ref: ./definitions/checkout_availability.yaml circ-rule-kind: $ref: ./definitions/circ-rule-kind.yaml city: -- 2.20.1