Skip to content

Commit e7d3c24

Browse files
committed
Fix Open API spec
Signed-off-by: RingoDev <[email protected]>
1 parent 5190f4b commit e7d3c24

File tree

1 file changed

+105
-47
lines changed

1 file changed

+105
-47
lines changed

spec/openapi.json

Lines changed: 105 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,9 @@
4343
}
4444
}
4545
},
46-
4746
"404": {
4847
"$ref": "#/components/responses/404-object-by-id-not-found"
4948
}
50-
5149
},
5250
"tags": [
5351
"TEA Product"
@@ -121,7 +119,9 @@
121119
"application/json": {}
122120
}
123121
},
124-
"401": { "$ref": "#/components/responses/401-unauthorized" },
122+
"401": {
123+
"$ref": "#/components/responses/401-unauthorized"
124+
},
125125
"404": {
126126
"$ref": "#/components/responses/404-object-by-id-not-found"
127127
}
@@ -271,7 +271,9 @@
271271
"application/json": {}
272272
}
273273
},
274-
"401": { "$ref": "#/components/responses/401-unauthorized" },
274+
"401": {
275+
"$ref": "#/components/responses/401-unauthorized"
276+
},
275277
"404": {
276278
"$ref": "#/components/responses/404-object-by-id-not-found"
277279
}
@@ -353,7 +355,9 @@
353355
"application/json": {}
354356
}
355357
},
356-
"401": { "$ref": "#/components/responses/401-unauthorized" },
358+
"401": {
359+
"$ref": "#/components/responses/401-unauthorized"
360+
},
357361
"404": {
358362
"$ref": "#/components/responses/404-object-by-id-not-found"
359363
}
@@ -450,7 +454,19 @@
450454
"application/json": {}
451455
}
452456
},
453-
"401": { "$ref": "#/components/responses/401-unauthorized" },
457+
"200": {
458+
"description": "New response",
459+
"content": {
460+
"application/json": {
461+
"schema": {
462+
"": ""
463+
}
464+
}
465+
}
466+
},
467+
"401": {
468+
"$ref": "#/components/responses/401-unauthorized"
469+
},
454470
"404": {
455471
"$ref": "#/components/responses/404-object-by-id-not-found"
456472
}
@@ -657,7 +673,9 @@
657673
"application/json": {}
658674
}
659675
},
660-
"401": { "$ref": "#/components/responses/401-unauthorized" },
676+
"401": {
677+
"$ref": "#/components/responses/401-unauthorized"
678+
},
661679
"404": {
662680
"$ref": "#/components/responses/404-object-by-id-not-found"
663681
}
@@ -841,7 +859,9 @@
841859
"application/json": {}
842860
}
843861
},
844-
"401": { "$ref": "#/components/responses/401-unauthorized" },
862+
"401": {
863+
"$ref": "#/components/responses/401-unauthorized"
864+
},
845865
"404": {
846866
"$ref": "#/components/responses/404-object-by-id-not-found"
847867
}
@@ -902,7 +922,9 @@
902922
},
903923
"base_versioned_product": {
904924
"allOf": [
905-
{ "$ref": "#/components/schemas/base_product_fields" },
925+
{
926+
"$ref": "#/components/schemas/base_product_fields"
927+
},
906928
{
907929
"type": "object",
908930
"properties": {
@@ -960,9 +982,44 @@
960982
}
961983
}
962984
},
985+
"page": {
986+
"type": "object",
987+
"properties": {
988+
"number": {
989+
"type": "integer"
990+
},
991+
"size": {
992+
"type": "integer"
993+
},
994+
"totalPages": {
995+
"type": "integer"
996+
}
997+
}
998+
},
999+
"paginated_product_list": {
1000+
"type": "object",
1001+
"allOf": [
1002+
{
1003+
"$ref": "#/components/schemas/page"
1004+
},
1005+
{
1006+
"type": "object",
1007+
"properties": {
1008+
"content": {
1009+
"type": "array",
1010+
"items": {
1011+
"$ref": "#/components/schemas/tea_product"
1012+
}
1013+
}
1014+
}
1015+
}
1016+
]
1017+
},
9631018
"tea_product": {
9641019
"allOf": [
965-
{ "$ref": "#/components/schemas/base_product_fields" },
1020+
{
1021+
"$ref": "#/components/schemas/base_product_fields"
1022+
},
9661023
{
9671024
"type": "object",
9681025
"properties": {
@@ -977,13 +1034,18 @@
9771034
"description": "Array of UUIDs referencing TEA Leaf entries"
9781035
}
9791036
},
980-
"required": ["identifier", "product_name"]
1037+
"required": [
1038+
"identifier",
1039+
"product_name"
1040+
]
9811041
}
9821042
]
9831043
},
9841044
"tea_leaf": {
9851045
"allOf": [
986-
{ "$ref": "#/components/schemas/base_versioned_product" },
1046+
{
1047+
"$ref": "#/components/schemas/base_versioned_product"
1048+
},
9871049
{
9881050
"type": "object",
9891051
"properties": {
@@ -1304,31 +1366,6 @@
13041366
"format": "uuid"
13051367
}
13061368
},
1307-
"responses": {
1308-
"base_error": {
1309-
"type": "object",
1310-
"properties": {
1311-
"error": {
1312-
"type": "string"
1313-
},
1314-
"message": {
1315-
"type": "string"
1316-
}
1317-
}
1318-
},
1319-
"404-object-by-id-not-found": {
1320-
"description": "Object requested by identifier not found",
1321-
"content": {
1322-
"application/json": {}
1323-
}
1324-
},
1325-
"401-unauthorized": {
1326-
"description": "Authentication required",
1327-
"content": {
1328-
"application/json": {}
1329-
}
1330-
}
1331-
},
13321369
"parameters": {
13331370
"page-offset": {
13341371
"name": "page-offset",
@@ -1423,6 +1460,14 @@
14231460
"schema": {
14241461
"$ref": "#/components/schemas/type_uuid"
14251462
}
1463+
},
1464+
"standard_pagination": {
1465+
"page_offset": {
1466+
"$ref": "#/components/parameters/page-offset"
1467+
},
1468+
"page_size": {
1469+
"$ref": "#/components/parameters/page-size"
1470+
}
14261471
}
14271472
},
14281473
"securitySchemes": {
@@ -1446,6 +1491,29 @@
14461491
]
14471492
},
14481493
"responses": {
1494+
"base_error": {
1495+
"type": "object",
1496+
"properties": {
1497+
"error": {
1498+
"type": "string"
1499+
},
1500+
"message": {
1501+
"type": "string"
1502+
}
1503+
}
1504+
},
1505+
"404-object-by-id-not-found": {
1506+
"description": "Object requested by identifier not found",
1507+
"content": {
1508+
"application/json": {}
1509+
}
1510+
},
1511+
"401-unauthorized": {
1512+
"description": "Authentication required",
1513+
"content": {
1514+
"application/json": {}
1515+
}
1516+
},
14491517
"standard_errors": {
14501518
"400": {
14511519
"description": "Invalid request body",
@@ -1466,16 +1534,6 @@
14661534
}
14671535
}
14681536
},
1469-
"parameters": {
1470-
"standard_pagination": {
1471-
"page_offset": {
1472-
"$ref": "#/components/parameters/page-offset"
1473-
},
1474-
"page_size": {
1475-
"$ref": "#/components/parameters/page-size"
1476-
}
1477-
}
1478-
},
14791537
"operations": {
14801538
"standard_delete": {
14811539
"responses": {

0 commit comments

Comments
 (0)