From 958d2a9d692e403bc2f6d602a229f05dec17a150 Mon Sep 17 00:00:00 2001 From: jkaliszuk Date: Mon, 27 Nov 2023 12:47:44 +0100 Subject: [PATCH 1/5] Removed unused schemas and fixed invalid links. --- reference/OpenAPI.json | 654 +---------------------------------------- 1 file changed, 1 insertion(+), 653 deletions(-) diff --git a/reference/OpenAPI.json b/reference/OpenAPI.json index be9a16adc..885ad08c3 100644 --- a/reference/OpenAPI.json +++ b/reference/OpenAPI.json @@ -16474,66 +16474,6 @@ } } }, - "7_obj_redemption_object": { - "title": "Redemption Object", - "description": "This is an object representing a redemption. \n\nRedemption is the key operation in the voucher and promotion tier lifecycle. A customer can redeem a voucher or promotion tier once or multiple times depending on selected limit (`quantity`). Each redemption is recorded in voucher/promotion's history (`redemption_entries`). There is also an option to cancel a redemption. We call such an operation a [redemption rollback](ref:rollback-redemption).", - "anyOf": [ - { - "$ref": "#/components/schemas/7_obj_redemption_object_discount_voucher" - }, - { - "$ref": "#/components/schemas/7_obj_redemption_object_loyalty_card" - }, - { - "$ref": "#/components/schemas/7_obj_redemption_object_gift_card" - }, - { - "$ref": "#/components/schemas/7_obj_redemption_object_promotion_tier" - }, - { - "$ref": "#/components/schemas/7_obj_redemption_object_stackable_discounts" - }, - { - "$ref": "#/components/schemas/7_obj_redemption_object_voucher_fail" - }, - { - "$ref": "#/components/schemas/7_obj_redemption_object_promotion_tier_fail" - }, - { - "$ref": "#/components/schemas/7_obj_redemption_object_fail" - } - ] - }, - "7_obj_redemption_object_voucher": { - "title": "Redemption Object", - "description": "This is an object representing an attempted or successful voucher redemption.", - "anyOf": [ - { - "$ref": "#/components/schemas/7_obj_redemption_object_discount_voucher" - }, - { - "$ref": "#/components/schemas/7_obj_redemption_object_loyalty_card" - }, - { - "$ref": "#/components/schemas/7_obj_redemption_object_gift_card" - }, - { - "$ref": "#/components/schemas/7_obj_redemption_object_voucher_fail" - }, - { - "$ref": "#/components/schemas/7_obj_redemption_rollback_object_discount_voucher" - }, - { - "$ref": "#/components/schemas/7_obj_redemption_rollback_object_gift_card" - }, - { - "$ref": "#/components/schemas/7_obj_redemption_rollback_object_loyalty_card" - }, - { - "$ref": "#/components/schemas/7_obj_redemption_rollback_object_voucher_fail" - } - ] - }, "7_obj_redemption_object_voucher_extended": { "title": "Redemption Object", "description": "This is an object representing an attempted or successful voucher redemption.", @@ -17570,598 +17510,6 @@ } } }, - "7_obj_rollback_redemption_object_truncated": { - "title": "Rollback Redemption Object", - "description": "This is an object representing an attempted or successful voucher or promotion tier rollback.", - "anyOf": [ - { - "$ref": "#/components/schemas/7_obj_redemption_rollback_object_discount_voucher" - }, - { - "$ref": "#/components/schemas/7_obj_redemption_rollback_object_loyalty_card" - }, - { - "$ref": "#/components/schemas/7_obj_redemption_rollback_object_gift_card" - }, - { - "$ref": "#/components/schemas/7_obj_redemption_rollback_object_promotion_tier" - }, - { - "$ref": "#/components/schemas/7_obj_redemption_rollback_object_voucher_fail" - }, - { - "$ref": "#/components/schemas/7_obj_redemption_rollback_object_promotion_tier_fail" - } - ] - }, - "7_obj_rollback_redemption_object_extended": { - "title": "Rollback Redemption Object", - "description": "This is an object representing an attempted or successful voucher or promotion tier rollback.", - "anyOf": [ - { - "$ref": "#/components/schemas/7_obj_rollback_redemption_object_discount_voucher_extended" - }, - { - "$ref": "#/components/schemas/7_obj_rollback_redemption_object_loyalty_card_extended" - }, - { - "$ref": "#/components/schemas/7_obj_rollback_redemption_object_gift_card_extended" - }, - { - "$ref": "#/components/schemas/7_obj_rollback_redemption_object_promotion_tier_extended" - } - ] - }, - "7_obj_rollback_redemption_object_discount_voucher_extended": { - "type": "object", - "title": "Discount Voucher", - "description": "This is an object representing a redemption.", - "properties": { - "id": { - "type": "string", - "example": "rr_0bc92f81a6801f9bca", - "description": "Unique rollback redemption ID." - }, - "object": { - "type": "string", - "description": "The type of object represented by the JSON. This object stores information about the `redemption_rollback`.", - "default": "redemption_rollback" - }, - "date": { - "type": "string", - "format": "date-time", - "example": "2022-10-03T12:24:58.008Z", - "description": "Timestamp in ISO 8601 format indicating when the redemption rollback occured." - }, - "customer_id": { - "type": "string", - "example": "cust_i8t5Tt6eiKG5K79KQlJ0Vs64", - "description": "Unique customer ID of the redeeming customer." - }, - "tracking_id": { - "type": "string", - "example": "track_fxEMFiLowFHg==", - "description": "Hashed customer source ID." - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes in the form of key/value pairs assigned to the redemption." - }, - "redemption": { - "type": "string", - "description": "The unique redemption ID of the initial redemption.", - "example": "r_0c5d6689b35320059a" - }, - "reason": { - "type": "string", - "description": "The reason for the redemption rollback." - }, - "result": { - "type": "string", - "enum": [ - "SUCCESS", - "FAILURE" - ], - "description": "Redemption rollback result." - }, - "order": { - "description": "Defines the details of the order that is related to the redemption rollback.", - "$ref": "#/components/schemas/7_obj_order_object_rollback" - }, - "channel": { - "type": "object", - "description": "Defines the details of the channel through which the redemption rollback was issued.", - "properties": { - "channel_id": { - "type": "string", - "example": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH", - "description": "Unique channel ID of the user performing the redemption rollback. This is either a user ID from a user using the Voucherify Dashboard or an X-APP-Id of a user using the API." - }, - "channel_type": { - "type": "string", - "description": "The source of the channel for the redemption rollback. A `USER` corresponds to the Voucherify Dashboard and an `API` corresponds to the API.", - "enum": [ - "USER", - "API" - ] - } - } - }, - "customer": { - "type": "object", - "description": "Defines the customer that is related to the redemption.", - "properties": { - "id": { - "type": "string", - "description": "The unique ID of a customer that is assigned by Voucherify.", - "example": "cust_eWgXlBBiY6THFRJwX45Iakv4" - }, - "name": { - "type": "string", - "description": "Customer's first and last name." - }, - "email": { - "type": "string", - "description": "Customer's email address." - }, - "source_id": { - "type": "string", - "description": "The merchant’s customer ID if it is different from the Voucherify customer ID. It is really useful in case of an integration between multiple systems. It can be a customer ID from a CRM system, database or 3rd-party service." - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the customer. A set of key/value pairs that you can attach to a customer object. It can be useful for storing additional information about the customer in a structured format." - }, - "object": { - "type": "string", - "description": "Type of object represented is `customer`.", - "default": "customer" - } - } - }, - "related_object_type": { - "type": "string", - "description": "Defines the related object.\n\n| **Related Object** | **Definition** |\n| :--- | :--- |\n| voucher | Either a discount voucher, gift card, or loyalty card. |", - "enum": [ - "voucher" - ] - }, - "related_object_id": { - "type": "string", - "description": "Unique related object ID assigned by Voucherify, i.e. v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno for a voucher." - }, - "voucher": { - "$ref": "#/components/schemas/Voucher", - "description": "Defines the details of the voucher being redeemed." - } - } - }, - "7_obj_rollback_redemption_object_loyalty_card_extended": { - "type": "object", - "title": "Loyalty Card Voucher", - "description": "This is an object representing a loyalty card rollback redemption.", - "properties": { - "id": { - "type": "string", - "example": "rr_0bc92f81a6801f9bca", - "description": "Unique redemption rollback ID." - }, - "object": { - "type": "string", - "description": "The type of object represented by the JSON. This object stores information about the `redemption_rollback`.", - "default": "redemption_rollback" - }, - "date": { - "type": "string", - "format": "date-time", - "example": "2022-10-03T12:24:58.008Z", - "description": "Timestamp in ISO 8601 format indicating when the redemption rollback occured." - }, - "customer_id": { - "type": "string", - "example": "cust_i8t5Tt6eiKG5K79KQlJ0Vs64", - "description": "Unique customer ID of the redeeming customer." - }, - "tracking_id": { - "type": "string", - "example": "track_fxEMFiLowFHg==", - "description": "Hashed customer source ID." - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes in the form of key/value pairs assigned to the redemption." - }, - "amount": { - "type": "integer", - "description": "Number of points being returned to the loyalty card." - }, - "redemption": { - "type": "string", - "description": "Unique redemption ID of the initial redemption.", - "example": "r_0b56726b09cfb73e84" - }, - "result": { - "type": "string", - "enum": [ - "SUCCESS", - "FAILURE" - ], - "description": "Redemption rollback result." - }, - "order": { - "description": "Defines the details of the order that is related to the redemption rollback.", - "$ref": "#/components/schemas/7_obj_order_object_rollback" - }, - "channel": { - "type": "object", - "description": "Defines the details of the channel through which the redemption rollback was issued.", - "properties": { - "channel_id": { - "type": "string", - "example": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH", - "description": "Unique channel ID of the user performing the redemption rollback. This is either a user ID from a user using the Voucherify Dashboard or an X-APP-Id of a user using the API." - }, - "channel_type": { - "type": "string", - "description": "The source of the channel for the redemption rollback. A `USER` corresponds to the Voucherify Dashboard and an `API` corresponds to the API.", - "enum": [ - "USER", - "API" - ] - } - } - }, - "customer": { - "type": "object", - "description": "Defines the customer redeeming the reward.", - "properties": { - "id": { - "type": "string", - "description": "The unique ID of a customer that is assigned by Voucherify.", - "example": "cust_eWgXlBBiY6THFRJwX45Iakv4" - }, - "name": { - "type": "string", - "description": "Customer's first and last name." - }, - "email": { - "type": "string", - "description": "Customer's email address." - }, - "source_id": { - "type": "string", - "description": "The merchant's customer ID if it is different from the Voucherify customer ID. It is really useful in case of an integration between multiple systems. It can be a customer ID from a CRM system, database or 3rd-party service." - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the customer. A set of key/value pairs that you can attach to a customer object. It can be useful for storing additional information about the customer in a structured format." - }, - "object": { - "type": "string", - "description": "Type of object represented is `customer`.", - "default": "customer" - } - } - }, - "related_object_type": { - "type": "string", - "description": "Defines the related object. i.e. `voucher`.", - "enum": [ - "voucher" - ] - }, - "related_object_id": { - "type": "string", - "description": "Unique related object ID assigned by Voucherify, i.e. v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno for a voucher." - }, - "voucher": { - "$ref": "#/components/schemas/Voucher", - "description": "Defines the details of the voucher being redeemed." - }, - "reward": { - "description": "Defines the reward being redeemed.", - "anyOf": [ - { - "$ref": "#/components/schemas/7_obj_redemption_object_loyalty_card_pay_with_points" - }, - { - "$ref": "#/components/schemas/7_obj_redemption_object_loyalty_card_material_product" - }, - { - "$ref": "#/components/schemas/7_obj_redemption_object_loyalty_card_material_sku" - }, - { - "$ref": "#/components/schemas/7_obj_redemption_object_loyalty_card_digital" - } - ] - }, - "loyalty_card": { - "type": "object", - "description": "Stores the number of points being added back to the loyalty card for the reward redemption rollback.", - "properties": { - "points": { - "type": "integer", - "description": "Number of points being returned to the loyalty card for the reward redemption rollback." - } - } - } - } - }, - "7_obj_rollback_redemption_object_gift_card_extended": { - "type": "object", - "title": "Gift Card", - "description": "This is an object representing a gift card rollback redemption.", - "properties": { - "id": { - "type": "string", - "example": "rr_0bc92f81a6801f9bca", - "description": "Unique redemption rollback ID." - }, - "object": { - "type": "string", - "description": "The type of object represented by the JSON. This object stores information about the `redemption_rollback`.", - "default": "redemption_rollback" - }, - "date": { - "type": "string", - "format": "date-time", - "example": "2022-10-03T12:24:58.008Z", - "description": "Timestamp in ISO 8601 format indicating when the redemption rollback occured." - }, - "customer_id": { - "type": "string", - "example": "cust_i8t5Tt6eiKG5K79KQlJ0Vs64", - "description": "Unique customer ID of the redeeming customer." - }, - "tracking_id": { - "type": "string", - "example": "track_fxEMFiLowFHg==", - "description": "Hashed customer source ID." - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes in the form of key/value pairs assigned to the redemption." - }, - "amount": { - "type": "integer", - "description": "The amount credited back to the gift card expressed as the smallest currency unit (e.g. 100 cents for $1.00)." - }, - "redemption": { - "type": "string", - "description": "Unique redemption ID of the initial redemption.", - "example": "r_0b56726b09cfb73e84" - }, - "result": { - "type": "string", - "enum": [ - "SUCCESS", - "FAILURE" - ], - "description": "Redemption rollback result." - }, - "order": { - "description": "Defines the details of the order that is related to the redemption rollback.", - "$ref": "#/components/schemas/7_obj_order_object_rollback" - }, - "channel": { - "type": "object", - "description": "Defines the details of the channel through which the redemption rollback was issued.", - "properties": { - "channel_id": { - "type": "string", - "example": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH", - "description": "Unique channel ID of the user performing the redemption rollback. This is either a user ID from a user using the Voucherify Dashboard or an X-APP-Id of a user using the API." - }, - "channel_type": { - "type": "string", - "description": "The source of the channel for the redemption rollback. A `USER` corresponds to the Voucherify Dashboard and an `API` corresponds to the API.", - "enum": [ - "USER", - "API" - ] - } - } - }, - "customer": { - "type": "object", - "description": "Defines the customer redeeming the gift card.", - "properties": { - "id": { - "type": "string", - "description": "The unique ID of a customer that is assigned by Voucherify.", - "example": "cust_eWgXlBBiY6THFRJwX45Iakv4" - }, - "name": { - "type": "string", - "description": "Customer's first and last name." - }, - "email": { - "type": "string", - "description": "Customer's email address." - }, - "source_id": { - "type": "string", - "description": "The merchant’s customer ID if it is different from the Voucherify customer ID. It is really useful in case of an integration between multiple systems. It can be a customer ID from a CRM system, database or 3rd-party service." - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the customer. A set of key/value pairs that you can attach to a customer object. It can be useful for storing additional information about the customer in a structured format." - }, - "object": { - "type": "string", - "description": "Type of object represented is `customer`.", - "default": "customer" - } - } - }, - "related_object_type": { - "type": "string", - "description": "Defines the related object.\n\n| **Related Object** | **Definition** |\n| :--- | :--- |\n| voucher | Either a discount voucher, gift card, or loyalty card. |", - "enum": [ - "voucher" - ] - }, - "related_object_id": { - "type": "string", - "description": "Unique related object ID assigned by Voucherify, i.e. v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno for a voucher." - }, - "voucher": { - "$ref": "#/components/schemas/Voucher", - "description": "Defines the details of the voucher being redeemed." - }, - "gift": { - "type": "object", - "description": "Contains the amount being added back to the gift card for the redemption rollback.", - "properties": { - "amount": { - "type": "integer", - "description": "The amount added back on the gift card expressed as the smallest currency unit (e.g. 100 cents for $1.00)." - } - } - } - } - }, - "7_obj_rollback_redemption_object_promotion_tier_extended": { - "type": "object", - "title": "Promotion Tier", - "description": "This is an object representing a promotion tier rollback redemption.", - "properties": { - "id": { - "type": "string", - "example": "rr_0bc92f81a6801f9bca", - "description": "Unique redemption rollback ID." - }, - "object": { - "type": "string", - "description": "The type of object represented by the JSON. This object stores information about the `redemption_rollback`.", - "default": "redemption" - }, - "date": { - "type": "string", - "format": "date-time", - "example": "2022-10-03T12:24:58.008Z", - "description": "Timestamp in ISO 8601 format indicating when the redemption rollback occured." - }, - "customer_id": { - "type": "string", - "example": "cust_i8t5Tt6eiKG5K79KQlJ0Vs64", - "description": "Unique customer ID of the redeeming customer." - }, - "tracking_id": { - "type": "string", - "example": "track_fxEMFiLowFHg==", - "description": "Hashed customer source ID." - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes in the form of key/value pairs assigned to the redemption." - }, - "redemption": { - "type": "string", - "description": "Unique redemption ID of the initial redemption.", - "example": "r_0b56726b09cfb73e84" - }, - "result": { - "type": "string", - "enum": [ - "SUCCESS", - "FAILURE" - ], - "description": "Redemption rollback result." - }, - "order": { - "description": "Defines the details of the order that is related to the redemption rollback.", - "$ref": "#/components/schemas/7_obj_order_object_rollback" - }, - "channel": { - "type": "object", - "description": "Defines the details of the channel through which the redemption rollback was issued.", - "properties": { - "channel_id": { - "type": "string", - "example": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH", - "description": "Unique channel ID of the user performing the rollback redemption. This is either a user ID from a user using the Voucherify Dashboard or an X-APP-Id of a user using the API." - }, - "channel_type": { - "type": "string", - "description": "The source of the channel for the redemption rollback. A `USER` corresponds to the Voucherify Dashboard and an `API` corresponds to the API.", - "enum": [ - "USER", - "API" - ] - } - } - }, - "customer": { - "type": "object", - "description": "Defines the customer that is related to the redemption.", - "properties": { - "id": { - "type": "string", - "description": "The unique ID of a customer that is assigned by Voucherify.", - "example": "cust_eWgXlBBiY6THFRJwX45Iakv4" - }, - "name": { - "type": "string", - "description": "Customer's first and last name." - }, - "email": { - "type": "string", - "description": "Customer's email address." - }, - "source_id": { - "type": "string", - "description": "The merchant’s customer ID if it is different from the Voucherify customer ID. It is really useful in case of an integration between multiple systems. It can be a customer ID from a CRM system, database or 3rd-party service." - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the customer. A set of key/value pairs that you can attach to a customer object. It can be useful for storing additional information about the customer in a structured format." - }, - "object": { - "type": "string", - "description": "Type of object represented is `customer`.", - "default": "customer" - } - } - }, - "related_object_type": { - "type": "string", - "description": "Defines the related object.", - "enum": [ - "promotion_tier" - ] - }, - "related_object_id": { - "type": "string", - "description": "Unique related object ID assigned by Voucherify, i.e. promo_NzjTc3ZXTe7md5SziK3uYtei for a promotion tier." - }, - "voucher": { - "type": "null" - }, - "promotion_tier": { - "type": "object", - "description": "Contains details of the promotion tier and the parent campaign.", - "properties": { - "id": { - "type": "string", - "description": "Unique promotion tier ID assigned by Voucherify.", - "example": "promo_NzjTc3ZXTe7md5SziK3uYtei" - }, - "campaign": { - "type": "object", - "description": "Promotion tier's parent campaign.", - "properties": { - "id": { - "type": "string", - "example": "camp_VEL7UX0jZjrvLx3hfNZBVzpq", - "description": "Unique ID assigned by Voucherify of the promotion tier's parent campaign." - } - } - } - } - } - } - }, "7_obj_redemption_object_discount_voucher": { "type": "object", "title": "Discount Voucher", @@ -39655,7 +39003,7 @@ }, "SimpleCustomerResponse": { "type": "object", - "description": "This is an object representing a customer. \n\nThis entity allows you to:\n* store customer details in Voucherify\n* link [redemptions](ref:list-redemptions) and [validations](ref:validate-voucher) to a particular customer\n* build customer segments and use them in validation rules. ", + "description": "This is an object representing a customer with limited properties used in Event Tracking endpoints.", "title": "Customer Object", "examples": [ { From 4eec2ad8b20494a6c72021b0fda2cb2c321c552d Mon Sep 17 00:00:00 2001 From: jkaliszuk Date: Thu, 30 Nov 2023 08:58:00 +0100 Subject: [PATCH 2/5] Added application_mode to stackable validation to ensure not found multiple model. --- reference/OpenAPI.json | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/reference/OpenAPI.json b/reference/OpenAPI.json index 885ad08c3..da68eb36b 100644 --- a/reference/OpenAPI.json +++ b/reference/OpenAPI.json @@ -14830,11 +14830,18 @@ }, "session": { "$ref": "#/components/schemas/Session" + }, + "application_mode": { + "type": "string", + "enum": [ + "ALL" + ] } }, "required": [ "valid", - "redeemables" + "redeemables", + "application_mode" ] }, "ValidationsValidateAtLeastOnePromotionMustBeValidResponseBody": { @@ -14877,11 +14884,19 @@ }, "session": { "$ref": "#/components/schemas/Session" + }, + "application_mode": { + "type": "string", + "enum": [ + "PARTIAL" + ] } }, "required": [ "valid", - "redeemables" + "redeemables", + "inapplicable_redeemables", + "application_mode" ] }, "RedeemableResultVoucherCode": { From b0e3c99844d3820252002fe8873944c0f09f58b9 Mon Sep 17 00:00:00 2001 From: jkaliszuk Date: Thu, 30 Nov 2023 09:02:35 +0100 Subject: [PATCH 3/5] Added script for counting oneOf responses. --- package.json | 3 ++- .../count-responses-with-multiple-options.ts | 19 +++++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 scripts/count-responses-with-multiple-options.ts diff --git a/package.json b/package.json index cb1ce88c6..407c9b3c4 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,8 @@ "remove-deprecated-from-openapi": "ts-node ./scripts/remove-deprecated-from-openapi.ts", "generate-open-api-with-specific-endpoints": "ts-node ./scripts/generate-open-api-with-specific-endpoints.ts", "manage-project": "ts-node ./scripts/build-md-tables-from-openapi.ts && ts-node ./scripts/manage-project.ts", - "readme-upload-missing-images": "ts-node ./scripts/readme-upload-missing-images.ts" + "readme-upload-missing-images": "ts-node ./scripts/readme-upload-missing-images.ts", + "count-responses-with-multiple-options": "ts-node ./scripts/count-responses-with-multiple-options.ts" }, "dependencies": { "axios": "^1.5.1", diff --git a/scripts/count-responses-with-multiple-options.ts b/scripts/count-responses-with-multiple-options.ts new file mode 100644 index 000000000..9549cff95 --- /dev/null +++ b/scripts/count-responses-with-multiple-options.ts @@ -0,0 +1,19 @@ +import path from "path"; +import fsPromises from "fs/promises"; + +const main = async () => { + const openApiPath = path.join(__dirname, "../reference/OpenAPI.json"); + const openAPIContent = JSON.parse( + (await fsPromises.readFile(openApiPath)).toString() + ); + + const schemas = openAPIContent.components.schemas; + + const schemasWithOneOf = Object.keys(schemas) + .filter(schemaName => schemaName.includes("ResponseBody")) + .filter(schemaName => schemas[schemaName].oneOf) + + console.log("Responses schemas with oneOf = ", schemasWithOneOf); +} + +main() From c21e423c8d8e2efd742dc019e50397d51cd66870 Mon Sep 17 00:00:00 2001 From: jkaliszuk Date: Thu, 30 Nov 2023 09:40:22 +0100 Subject: [PATCH 4/5] Simplify ValidationsValidate responses. --- reference/OpenAPI.json | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/reference/OpenAPI.json b/reference/OpenAPI.json index da68eb36b..f32cd08e5 100644 --- a/reference/OpenAPI.json +++ b/reference/OpenAPI.json @@ -14661,10 +14661,10 @@ "description": "Response body schema for POST `/validations`.", "oneOf": [ { - "$ref": "#/components/schemas/ValidationsValidateAllProvidedPromotionsMustBeValidResponseBody" + "$ref": "#/components/schemas/ValidationsValidateAllResponseBody" }, { - "$ref": "#/components/schemas/ValidationsValidateAtLeastOnePromotionMustBeValidResponseBody" + "$ref": "#/components/schemas/ValidationsValidatePartialResponseBody" } ] }, @@ -14795,8 +14795,9 @@ } } }, - "ValidationsValidateAllProvidedPromotionsMustBeValidResponseBody": { - "title": "All Provided Promotions Must Be Valid", + "ValidationsValidateAllResponseBody": { + "title": "Validations Validate All", + "description": "Validations mode where all promotion must be valid" "type": "object", "properties": { "valid": { @@ -14844,8 +14845,9 @@ "application_mode" ] }, - "ValidationsValidateAtLeastOnePromotionMustBeValidResponseBody": { - "title": "At Least One Promotion Must Be Valid", + "ValidationsValidatePartialResponseBody": { + "title": "Validations Validate Partial", + "description": "Validations mode where at least one promotion must be valid" "type": "object", "properties": { "valid": { From 0209a66cddab25bd3dd680efc121f83c479224c0 Mon Sep 17 00:00:00 2001 From: jkaliszuk Date: Thu, 30 Nov 2023 09:59:58 +0100 Subject: [PATCH 5/5] Fixed json. --- reference/OpenAPI.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/reference/OpenAPI.json b/reference/OpenAPI.json index f32cd08e5..f456a0f26 100644 --- a/reference/OpenAPI.json +++ b/reference/OpenAPI.json @@ -14797,7 +14797,7 @@ }, "ValidationsValidateAllResponseBody": { "title": "Validations Validate All", - "description": "Validations mode where all promotion must be valid" + "description": "Validations mode where all promotion must be valid", "type": "object", "properties": { "valid": { @@ -14847,7 +14847,7 @@ }, "ValidationsValidatePartialResponseBody": { "title": "Validations Validate Partial", - "description": "Validations mode where at least one promotion must be valid" + "description": "Validations mode where at least one promotion must be valid", "type": "object", "properties": { "valid": {