From 203ae1cb3e8ed8aaa30b7e3a3a38c35dcbe1c860 Mon Sep 17 00:00:00 2001 From: Damilola Odujoko Date: Fri, 24 Oct 2025 14:10:05 +0100 Subject: [PATCH] chore: update pages examples and descriptions --- dist/paystack.yaml | 35 +++++++++++++++---- .../components/schemas/PageCreate.yaml | 3 ++ .../components/schemas/PageProduct.yaml | 12 ++++--- .../components/schemas/PageUpdate.yaml | 5 +-- src/assets/openapi/paths/page.yaml | 4 +++ .../page_check_slug_availability_{slug}.yaml | 3 ++ src/assets/openapi/paths/page_{id}.yaml | 6 +++- .../openapi/paths/page_{id}_product.yaml | 3 ++ 8 files changed, 58 insertions(+), 13 deletions(-) diff --git a/dist/paystack.yaml b/dist/paystack.yaml index 777a170..846b935 100644 --- a/dist/paystack.yaml +++ b/dist/paystack.yaml @@ -4070,6 +4070,7 @@ paths: tags: - Page summary: Create Page + description: Create a webpage to receive payments operationId: page_create requestBody: content: @@ -4090,13 +4091,16 @@ paths: tags: - Page summary: List Pages + description: List all previously created payment pages operationId: page_list parameters: - in: query name: perPage schema: type: integer + default: 50 description: Number of records to fetch per page + example: 10 - in: query name: page schema: @@ -4127,13 +4131,16 @@ paths: parameters: - name: id in: path + description: The unique identifier of a payment page required: true schema: - type: string + type: integer + example: 1891222 get: tags: - Page summary: Fetch Page + description: Get a previously created payment page operationId: page_fetch responses: '200': @@ -4148,6 +4155,7 @@ paths: tags: - Page summary: Update Page + description: Update a previously created payment page operationId: page_update requestBody: content: @@ -4170,13 +4178,16 @@ paths: parameters: - name: slug in: path + description: The custom slug to check required: true schema: type: string + example: risky-burger get: tags: - Page summary: Check Slug Availability + description: Check if a custom slug is available for use when creating a payment page operationId: page_checkSlugAvailability responses: '200': @@ -4198,6 +4209,9 @@ paths: tags: - Page summary: Add Products + description: | + Add products to a previously created payment page. You can only add products to pages + that was created with a `product` type. operationId: page_addProducts requestBody: content: @@ -15715,6 +15729,9 @@ components: type: array items: type: object + example: + name: Extra Charges + amount: 200000 PageCreateResponse: type: object properties: @@ -15858,11 +15875,13 @@ components: description: The description of the page type: string amount: - description: Amount should be in kobo if currency is NGN, pesewas, if currency is GHS, and cents, if currency is ZAR + description: Amount should be in the subunit of the currency type: integer active: description: Set to false to deactivate page url type: boolean + example: + name: Backyard Sale PageUpdateResponse: type: object properties: @@ -15957,13 +15976,17 @@ components: PageProduct: type: object required: - - product + - products properties: - product: - description: IDs of all products to add to a page + products: + description: A list of IDs of products to add to a page. type: array items: - type: string + type: integer + example: + products: + - 2196244 + - 2179824 PageProductsArray: type: object properties: diff --git a/src/assets/openapi/components/schemas/PageCreate.yaml b/src/assets/openapi/components/schemas/PageCreate.yaml index b21cbb6..ddf77a2 100644 --- a/src/assets/openapi/components/schemas/PageCreate.yaml +++ b/src/assets/openapi/components/schemas/PageCreate.yaml @@ -77,3 +77,6 @@ properties: type: array items: type: object +example: + name: "Extra Charges" + amount: 200000 \ No newline at end of file diff --git a/src/assets/openapi/components/schemas/PageProduct.yaml b/src/assets/openapi/components/schemas/PageProduct.yaml index 89160a2..2646aea 100644 --- a/src/assets/openapi/components/schemas/PageProduct.yaml +++ b/src/assets/openapi/components/schemas/PageProduct.yaml @@ -1,9 +1,13 @@ type: object required: - - product + - products properties: - product: - description: IDs of all products to add to a page + products: + description: A list of IDs of products to add to a page. type: array items: - type: string + type: integer +example: + products: + - 2196244 + - 2179824 diff --git a/src/assets/openapi/components/schemas/PageUpdate.yaml b/src/assets/openapi/components/schemas/PageUpdate.yaml index 7818df9..eb5cec3 100644 --- a/src/assets/openapi/components/schemas/PageUpdate.yaml +++ b/src/assets/openapi/components/schemas/PageUpdate.yaml @@ -8,9 +8,10 @@ properties: type: string amount: description: >- - Amount should be in kobo if currency is NGN, pesewas, if currency is GHS, - and cents, if currency is ZAR + Amount should be in the subunit of the currency type: integer active: description: Set to false to deactivate page url type: boolean +example: + name: "Backyard Sale" \ No newline at end of file diff --git a/src/assets/openapi/paths/page.yaml b/src/assets/openapi/paths/page.yaml index 1f14069..6f470c1 100644 --- a/src/assets/openapi/paths/page.yaml +++ b/src/assets/openapi/paths/page.yaml @@ -2,6 +2,7 @@ post: tags: - Page summary: Create Page + description: Create a webpage to receive payments operationId: page_create requestBody: content: @@ -22,13 +23,16 @@ get: tags: - Page summary: List Pages + description: List all previously created payment pages operationId: page_list parameters: - in: query name: perPage schema: type: integer + default: 50 description: Number of records to fetch per page + example: 10 - in: query name: page schema: diff --git a/src/assets/openapi/paths/page_check_slug_availability_{slug}.yaml b/src/assets/openapi/paths/page_check_slug_availability_{slug}.yaml index 69c67cd..8491194 100644 --- a/src/assets/openapi/paths/page_check_slug_availability_{slug}.yaml +++ b/src/assets/openapi/paths/page_check_slug_availability_{slug}.yaml @@ -1,13 +1,16 @@ parameters: - name: slug in: path + description: The custom slug to check required: true schema: type: string + example: risky-burger get: tags: - Page summary: Check Slug Availability + description: Check if a custom slug is available for use when creating a payment page operationId: page_checkSlugAvailability responses: '200': diff --git a/src/assets/openapi/paths/page_{id}.yaml b/src/assets/openapi/paths/page_{id}.yaml index 55fde57..9246f75 100644 --- a/src/assets/openapi/paths/page_{id}.yaml +++ b/src/assets/openapi/paths/page_{id}.yaml @@ -1,13 +1,16 @@ parameters: - name: id in: path + description: The unique identifier of a payment page required: true schema: - type: string + type: integer + example: 1891222 get: tags: - Page summary: Fetch Page + description: Get a previously created payment page operationId: page_fetch responses: '200': @@ -22,6 +25,7 @@ put: tags: - Page summary: Update Page + description: Update a previously created payment page operationId: page_update requestBody: content: diff --git a/src/assets/openapi/paths/page_{id}_product.yaml b/src/assets/openapi/paths/page_{id}_product.yaml index ad3bee8..3128db3 100644 --- a/src/assets/openapi/paths/page_{id}_product.yaml +++ b/src/assets/openapi/paths/page_{id}_product.yaml @@ -8,6 +8,9 @@ post: tags: - Page summary: Add Products + description: | + Add products to a previously created payment page. You can only add products to pages + that was created with a `product` type. operationId: page_addProducts requestBody: content: