Skip to content

Commit 6ff4a91

Browse files
committed
feat: format open api using yq
1 parent e8c221a commit 6ff4a91

11 files changed

Lines changed: 19459 additions & 39229 deletions

xero-app-store.yaml

Lines changed: 21 additions & 119 deletions
Original file line numberDiff line numberDiff line change
@@ -30,57 +30,7 @@ paths:
3030
application/json:
3131
schema:
3232
$ref: "#/components/schemas/Subscription"
33-
example: {
34-
"currentPeriodEnd": "2021-07-20T03:13:48",
35-
"endDate": "2021-07-20T03:13:48",
36-
"id": "01b5a6f4-8936-4bfa-b703-830702312b87",
37-
"testMode": true,
38-
"organisationId": "fdc5be44-9b3e-4ebb-a0e9-11b9737f9a28",
39-
"plans": [
40-
{
41-
"id": "f617dd59-462f-46a1-9519-1765fd38b160",
42-
"name": "Small",
43-
"status": "ACTIVE",
44-
"subscriptionItems": [
45-
{
46-
"endDate": "2021-07-20T03:13:48",
47-
"id": "c7336bf6-8a47-4f13-9fc0-82420e6922c8",
48-
"testMode": true,
49-
"price": {
50-
"amount": 50,
51-
"currency": "AUD",
52-
"id": "31acefbe-bdb7-4329-84d6-51e9afd95327"
53-
},
54-
"product": {
55-
"id": "56d66073-ff78-497b-a726-ca9d56fdafa3",
56-
"name": "Small",
57-
"type": "FIXED"
58-
},
59-
"quantity": 1,
60-
"startDate": "2021-07-20T03:13:48"
61-
},
62-
{
63-
"endDate": "2021-07-20T03:13:48",
64-
"id": "1a25bc96-141a-4e42-a0fa-55ed51844da4",
65-
"testMode": true,
66-
"price": {
67-
"amount": 0.20,
68-
"currency": "AUD",
69-
"id": "15c65048-1b48-4d9f-81c0-4e1cd3a4f49c"
70-
},
71-
"product": {
72-
"id": "e8d8ac02-01b3-47f7-8a22-99cfe9035cf7",
73-
"name": "Texts",
74-
"type": "METERED",
75-
"usageUnit": "txt"
76-
},
77-
}
78-
]
79-
}
80-
],
81-
"startDate": "2021-07-20T03:13:48",
82-
"status": "ACTIVE"
83-
}
33+
example: {"currentPeriodEnd": "2021-07-20T03:13:48", "endDate": "2021-07-20T03:13:48", "id": "01b5a6f4-8936-4bfa-b703-830702312b87", "testMode": true, "organisationId": "fdc5be44-9b3e-4ebb-a0e9-11b9737f9a28", "plans": [{"id": "f617dd59-462f-46a1-9519-1765fd38b160", "name": "Small", "status": "ACTIVE", "subscriptionItems": [{"endDate": "2021-07-20T03:13:48", "id": "c7336bf6-8a47-4f13-9fc0-82420e6922c8", "testMode": true, "price": {"amount": 50, "currency": "AUD", "id": "31acefbe-bdb7-4329-84d6-51e9afd95327"}, "product": {"id": "56d66073-ff78-497b-a726-ca9d56fdafa3", "name": "Small", "type": "FIXED"}, "quantity": 1, "startDate": "2021-07-20T03:13:48"}, {"endDate": "2021-07-20T03:13:48", "id": "1a25bc96-141a-4e42-a0fa-55ed51844da4", "testMode": true, "price": {"amount": 0.20, "currency": "AUD", "id": "15c65048-1b48-4d9f-81c0-4e1cd3a4f49c"}, "product": {"id": "e8d8ac02-01b3-47f7-8a22-99cfe9035cf7", "name": "Texts", "type": "METERED", "usageUnit": "txt"}}]}], "startDate": "2021-07-20T03:13:48", "status": "ACTIVE"}
8434
"404":
8535
content:
8636
application/json:
@@ -106,16 +56,7 @@ paths:
10656
application/json:
10757
schema:
10858
$ref: "#/components/schemas/UsageRecord"
109-
example: {
110-
"usageRecordId": "2a90f7d9-4c10-4a23-9c34-b47225167a48",
111-
"subscriptionId": "391be708-878a-4741-acfb-c0bc9a165bdb",
112-
"subscriptionItemId": "b22b150f-a0db-447d-9117-d922110add64",
113-
"productId": "d2b133d9-95d8-4446-807a-ae7ebc7353f6",
114-
"pricePerUnit": 0.10,
115-
"quantity": 22,
116-
"testMode": true,
117-
"recordedAt": "2022-09-13T02:11:22"
118-
}
59+
example: {"usageRecordId": "2a90f7d9-4c10-4a23-9c34-b47225167a48", "subscriptionId": "391be708-878a-4741-acfb-c0bc9a165bdb", "subscriptionItemId": "b22b150f-a0db-447d-9117-d922110add64", "productId": "d2b133d9-95d8-4446-807a-ae7ebc7353f6", "pricePerUnit": 0.10, "quantity": 22, "testMode": true, "recordedAt": "2022-09-13T02:11:22"}
11960
"404":
12061
content:
12162
application/json:
@@ -129,10 +70,7 @@ paths:
12970
application/json:
13071
schema:
13172
$ref: "#/components/schemas/CreateUsageRecord"
132-
example: {
133-
"timestamp": "2022-01-21T13:01:00",
134-
"quantity": 10
135-
}
73+
example: {"timestamp": "2022-01-21T13:01:00", "quantity": 10}
13674
description: Contains the quantity for the usage record to create
13775
required: true
13876
"/subscriptions/{subscriptionId}/items/{subscriptionItemId}/usage-records/{usageRecordId}":
@@ -153,16 +91,7 @@ paths:
15391
application/json:
15492
schema:
15593
$ref: "#/components/schemas/UsageRecord"
156-
example: {
157-
"usageRecordId": "2a90f7d9-4c10-4a23-9c34-b47225167a48",
158-
"subscriptionId": "391be708-878a-4741-acfb-c0bc9a165bdb",
159-
"subscriptionItemId": "b22b150f-a0db-447d-9117-d922110add64",
160-
"productId": "d2b133d9-95d8-4446-807a-ae7ebc7353f6",
161-
"pricePerUnit": 0.10,
162-
"quantity": 22,
163-
"testMode": true,
164-
"recordedAt": "2022-09-13T02:11:22"
165-
}
94+
example: {"usageRecordId": "2a90f7d9-4c10-4a23-9c34-b47225167a48", "subscriptionId": "391be708-878a-4741-acfb-c0bc9a165bdb", "subscriptionItemId": "b22b150f-a0db-447d-9117-d922110add64", "productId": "d2b133d9-95d8-4446-807a-ae7ebc7353f6", "pricePerUnit": 0.10, "quantity": 22, "testMode": true, "recordedAt": "2022-09-13T02:11:22"}
16695
"404":
16796
content:
16897
application/json:
@@ -176,9 +105,7 @@ paths:
176105
application/json:
177106
schema:
178107
$ref: "#/components/schemas/UpdateUsageRecord"
179-
example: {
180-
"quantity": 10
181-
}
108+
example: {"quantity": 10}
182109
description: Contains the quantity for the usage record to update
183110
required: true
184111
"/subscriptions/{subscriptionId}/usage-records":
@@ -196,30 +123,7 @@ paths:
196123
application/json:
197124
schema:
198125
$ref: "#/components/schemas/UsageRecordsList"
199-
example: {
200-
"usageRecords": [
201-
{
202-
"usageRecordId": "206100d3-e18b-4c59-9372-e98e4367a73f",
203-
"subscriptionId": "7c7684cf-bbfa-4fa8-8f44-eba8d1acdc5d",
204-
"subscriptionItemId": "264f6fa2-65e6-48f4-8a92-57cde5499742",
205-
"productId": "b040838b-f85e-4e7c-8dba-5a8501e5d312",
206-
"pricePerUnit": 2.0,
207-
"quantity": 12,
208-
"testMode": false,
209-
"recordedAt": "2022-01-01T00:00:00"
210-
},
211-
{
212-
"usageRecordId": "47d61dc9-3c99-4587-8d55-0985f47df4a6",
213-
"subscriptionId": "7c7684cf-bbfa-4fa8-8f44-eba8d1acdc5d",
214-
"subscriptionItemId": "264f6fa2-65e6-48f4-8a92-57cde5499742",
215-
"productId": "ec8033e8-5e3c-4795-bfb4-bfb85fa4557e",
216-
"pricePerUnit": 5.0,
217-
"quantity": 2,
218-
"testMode": false,
219-
"recordedAt": "2022-01-01T00:00:00"
220-
}
221-
]
222-
}
126+
example: {"usageRecords": [{"usageRecordId": "206100d3-e18b-4c59-9372-e98e4367a73f", "subscriptionId": "7c7684cf-bbfa-4fa8-8f44-eba8d1acdc5d", "subscriptionItemId": "264f6fa2-65e6-48f4-8a92-57cde5499742", "productId": "b040838b-f85e-4e7c-8dba-5a8501e5d312", "pricePerUnit": 2.0, "quantity": 12, "testMode": false, "recordedAt": "2022-01-01T00:00:00"}, {"usageRecordId": "47d61dc9-3c99-4587-8d55-0985f47df4a6", "subscriptionId": "7c7684cf-bbfa-4fa8-8f44-eba8d1acdc5d", "subscriptionItemId": "264f6fa2-65e6-48f4-8a92-57cde5499742", "productId": "ec8033e8-5e3c-4795-bfb4-bfb85fa4557e", "pricePerUnit": 5.0, "quantity": 2, "testMode": false, "recordedAt": "2022-01-01T00:00:00"}]}
223127
"404":
224128
content:
225129
application/json:
@@ -323,9 +227,9 @@ components:
323227
description: Status of the subscription. Available statuses are ACTIVE, CANCELED, and PAST_DUE.
324228
type: string
325229
enum:
326-
- ACTIVE
327-
- CANCELED
328-
- PAST_DUE
230+
- ACTIVE
231+
- CANCELED
232+
- PAST_DUE
329233
testMode:
330234
description: Boolean used to indicate if the subscription is in test mode
331235
type: boolean
@@ -354,9 +258,9 @@ components:
354258
PENDING_ACTIVATION.
355259
type: string
356260
enum:
357-
- ACTIVE
358-
- CANCELED
359-
- PENDING_ACTIVATION
261+
- ACTIVE
262+
- CANCELED
263+
- PENDING_ACTIVATION
360264
subscriptionItems:
361265
description: |
362266
List of the subscription items belonging to the plan. It does not
@@ -437,9 +341,9 @@ components:
437341
PENDING_ACTIVATION.
438342
type: string
439343
enum:
440-
- ACTIVE
441-
- CANCELED
442-
- PENDING_ACTIVATION
344+
- ACTIVE
345+
- CANCELED
346+
- PENDING_ACTIVATION
443347
testMode:
444348
description: If the subscription is a test subscription
445349
type: boolean
@@ -469,9 +373,9 @@ components:
469373
* METERED: Customers are charged per use of this product
470374
type: string
471375
enum:
472-
- FIXED
473-
- PER_SEAT
474-
- METERED
376+
- FIXED
377+
- PER_SEAT
378+
- METERED
475379
usageUnit:
476380
description: The unit of the usage product. e.g. "user", "minutes", "SMS", etc
477381
type: string
@@ -534,8 +438,7 @@ components:
534438
description: Data transfer object for public create usage end point
535439
properties:
536440
quantity:
537-
description: The initial quantity for the usage record. Must be a whole number
538-
that is greater than or equal to 0
441+
description: The initial quantity for the usage record. Must be a whole number that is greater than or equal to 0
539442
format: int32
540443
type: integer
541444
timestamp:
@@ -551,10 +454,9 @@ components:
551454
description: Data transfer object for public update usage end point
552455
properties:
553456
quantity:
554-
description: The new quantity for the usage record. Must be a whole number that
555-
is greater than or equal to 0
457+
description: The new quantity for the usage record. Must be a whole number that is greater than or equal to 0
556458
format: int32
557459
type: integer
558460
required:
559461
- quantity
560-
type: object
462+
type: object

0 commit comments

Comments
 (0)