Skip to content

Commit 1c84fdf

Browse files
Merge pull request #56 from PaystackOSS/patch-product
chore: add examples to the product endpoints
2 parents 8fe7858 + 6ca412b commit 1c84fdf

File tree

5 files changed

+44
-2
lines changed

5 files changed

+44
-2
lines changed

dist/paystack.yaml

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3350,6 +3350,7 @@ paths:
33503350
tags:
33513351
- Product
33523352
summary: Create Product
3353+
description: Create a new product on your integration
33533354
operationId: product_create
33543355
requestBody:
33553356
content:
@@ -3370,20 +3371,25 @@ paths:
33703371
tags:
33713372
- Product
33723373
summary: List Products
3374+
description: List all previously created products
33733375
operationId: product_list
33743376
parameters:
33753377
- name: perPage
3378+
description: Number of records to fetch per page
33763379
in: query
33773380
schema:
33783381
type: integer
33793382
- name: page
3383+
description: The section to retrieve
33803384
in: query
33813385
schema:
33823386
type: integer
33833387
- name: active
3388+
description: The state of the product
33843389
in: query
33853390
schema:
33863391
type: boolean
3392+
example: true
33873393
- in: query
33883394
name: from
33893395
schema:
@@ -3408,14 +3414,17 @@ paths:
34083414
/product/{id}:
34093415
parameters:
34103416
- name: id
3417+
description: The unique identifier of the product
34113418
in: path
34123419
required: true
34133420
schema:
3414-
type: string
3421+
type: integer
3422+
example: 2196244
34153423
get:
34163424
tags:
34173425
- Product
34183426
summary: Fetch Product
3427+
description: Fetch a previously created product
34193428
operationId: product_fetch
34203429
responses:
34213430
'200':
@@ -3430,6 +3439,7 @@ paths:
34303439
tags:
34313440
- Product
34323441
summary: Update product
3442+
description: Update a previously created product
34333443
operationId: product_update
34343444
requestBody:
34353445
content:
@@ -3452,6 +3462,7 @@ paths:
34523462
tags:
34533463
- Product
34543464
summary: Delete Product
3465+
description: Delete a previously created product
34553466
operationId: product_delete
34563467
responses:
34573468
'200':
@@ -12917,6 +12928,11 @@ components:
1291712928
metadata:
1291812929
description: Stringified JSON object of custom data
1291912930
type: string
12931+
example:
12932+
name: Cups
12933+
description: Environment friendly paper cups
12934+
price: 10000
12935+
currency: NGN
1292012936
ProductCreateResponse:
1292112937
type: object
1292212938
properties:
@@ -13202,6 +13218,11 @@ components:
1320213218
metadata:
1320313219
description: JSON object of custom data
1320413220
type: object
13221+
example:
13222+
name: Spoon
13223+
description: Environment friendly paper spoons
13224+
price: 5000
13225+
currency: NGN
1320513226
ProductUpdateResponse:
1320613227
type: object
1320713228
properties:

src/assets/openapi/components/schemas/ProductCreate.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,8 @@ properties:
3434
metadata:
3535
description: Stringified JSON object of custom data
3636
type: string
37+
example:
38+
name: Cups
39+
description: Environment friendly paper cups
40+
price: 10000
41+
currency: NGN

src/assets/openapi/components/schemas/ProductUpdate.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,8 @@ properties:
2929
metadata:
3030
description: JSON object of custom data
3131
type: object
32+
example:
33+
name: Spoon
34+
description: Environment friendly paper spoons
35+
price: 5000
36+
currency: NGN

src/assets/openapi/paths/product.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ post:
22
tags:
33
- Product
44
summary: Create Product
5+
description: Create a new product on your integration
56
operationId: product_create
67
requestBody:
78
content:
@@ -22,20 +23,25 @@ get:
2223
tags:
2324
- Product
2425
summary: List Products
26+
description: List all previously created products
2527
operationId: product_list
2628
parameters:
2729
- name: perPage
30+
description: Number of records to fetch per page
2831
in: query
2932
schema:
3033
type: integer
3134
- name: page
35+
description: The section to retrieve
3236
in: query
3337
schema:
3438
type: integer
3539
- name: active
40+
description: The state of the product
3641
in: query
3742
schema:
3843
type: boolean
44+
example: true
3945
- in: query
4046
name: from
4147
schema:

src/assets/openapi/paths/product_{id}.yaml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
11
parameters:
22
- name: id
3+
description: The unique identifier of the product
34
in: path
45
required: true
56
schema:
6-
type: string
7+
type: integer
8+
example: 2196244
79
get:
810
tags:
911
- Product
1012
summary: Fetch Product
13+
description: Fetch a previously created product
1114
operationId: product_fetch
1215
responses:
1316
'200':
@@ -22,6 +25,7 @@ put:
2225
tags:
2326
- Product
2427
summary: Update product
28+
description: Update a previously created product
2529
operationId: product_update
2630
requestBody:
2731
content:
@@ -44,6 +48,7 @@ delete:
4448
tags:
4549
- Product
4650
summary: Delete Product
51+
description: Delete a previously created product
4752
operationId: product_delete
4853
responses:
4954
'200':

0 commit comments

Comments
 (0)