Skip to content

Commit 27bb50d

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

File tree

1 file changed

+109
-126
lines changed

1 file changed

+109
-126
lines changed

spec/openapi.json

Lines changed: 109 additions & 126 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
}
@@ -146,7 +146,19 @@
146146
"$ref": "#/components/parameters/tea_product_identifier"
147147
}
148148
],
149-
"$ref": "#/components/operations/standard_delete",
149+
"responses": {
150+
"204": {
151+
"description": "Resource successfully deleted"
152+
}
153+
},
154+
"security": [
155+
{
156+
"bearerAuth": []
157+
},
158+
{
159+
"basicAuth": []
160+
}
161+
],
150162
"tags": [
151163
"TEA Product"
152164
]
@@ -158,7 +170,10 @@
158170
"operationId": "listTeaProducts",
159171
"parameters": [
160172
{
161-
"$ref": "#/components/parameters/standard_pagination"
173+
"$ref": "#/components/parameters/page-offset"
174+
},
175+
{
176+
"$ref": "#/components/parameters/page-size"
162177
}
163178
],
164179
"responses": {
@@ -172,7 +187,18 @@
172187
}
173188
}
174189
},
175-
"$ref": "#/components/responses/standard_errors"
190+
"400": {
191+
"description": "Invalid request body",
192+
"content": {
193+
"application/json": {}
194+
}
195+
},
196+
"401": {
197+
"$ref": "#/components/responses/401-unauthorized"
198+
},
199+
"404": {
200+
"$ref": "#/components/responses/404-object-by-id-not-found"
201+
}
176202
}
177203
},
178204
"post": {
@@ -271,7 +297,9 @@
271297
"application/json": {}
272298
}
273299
},
274-
"401": { "$ref": "#/components/responses/401-unauthorized" },
300+
"401": {
301+
"$ref": "#/components/responses/401-unauthorized"
302+
},
275303
"404": {
276304
"$ref": "#/components/responses/404-object-by-id-not-found"
277305
}
@@ -353,7 +381,9 @@
353381
"application/json": {}
354382
}
355383
},
356-
"401": { "$ref": "#/components/responses/401-unauthorized" },
384+
"401": {
385+
"$ref": "#/components/responses/401-unauthorized"
386+
},
357387
"404": {
358388
"$ref": "#/components/responses/404-object-by-id-not-found"
359389
}
@@ -450,7 +480,9 @@
450480
"application/json": {}
451481
}
452482
},
453-
"401": { "$ref": "#/components/responses/401-unauthorized" },
483+
"401": {
484+
"$ref": "#/components/responses/401-unauthorized"
485+
},
454486
"404": {
455487
"$ref": "#/components/responses/404-object-by-id-not-found"
456488
}
@@ -475,7 +507,19 @@
475507
"$ref": "#/components/parameters/tea_leaf_identifier"
476508
}
477509
],
478-
"$ref": "#/components/operations/standard_delete",
510+
"responses": {
511+
"204": {
512+
"description": "Resource successfully deleted"
513+
}
514+
},
515+
"security": [
516+
{
517+
"bearerAuth": []
518+
},
519+
{
520+
"basicAuth": []
521+
}
522+
],
479523
"tags": [
480524
"TEA Leaf"
481525
]
@@ -657,7 +701,9 @@
657701
"application/json": {}
658702
}
659703
},
660-
"401": { "$ref": "#/components/responses/401-unauthorized" },
704+
"401": {
705+
"$ref": "#/components/responses/401-unauthorized"
706+
},
661707
"404": {
662708
"$ref": "#/components/responses/404-object-by-id-not-found"
663709
}
@@ -841,7 +887,9 @@
841887
"application/json": {}
842888
}
843889
},
844-
"401": { "$ref": "#/components/responses/401-unauthorized" },
890+
"401": {
891+
"$ref": "#/components/responses/401-unauthorized"
892+
},
845893
"404": {
846894
"$ref": "#/components/responses/404-object-by-id-not-found"
847895
}
@@ -866,14 +914,25 @@
866914
"$ref": "#/components/parameters/tea_collection_identifier"
867915
}
868916
],
869-
"$ref": "#/components/operations/standard_delete",
917+
"security": [
918+
{
919+
"bearerAuth": []
920+
},
921+
{
922+
"basicAuth": []
923+
}
924+
],
925+
"responses": {
926+
"204": {
927+
"description": "Resource successfully deleted"
928+
}
929+
},
870930
"tags": [
871931
"TEA Collection"
872932
]
873933
}
874934
}
875935
},
876-
"webhooks": {},
877936
"components": {
878937
"schemas": {
879938
"base_product_fields": {
@@ -902,7 +961,9 @@
902961
},
903962
"base_versioned_product": {
904963
"allOf": [
905-
{ "$ref": "#/components/schemas/base_product_fields" },
964+
{
965+
"$ref": "#/components/schemas/base_product_fields"
966+
},
906967
{
907968
"type": "object",
908969
"properties": {
@@ -918,51 +979,30 @@
918979
}
919980
]
920981
},
921-
"base_artifact_object": {
982+
"paginated_product_list": {
922983
"type": "object",
923-
"properties": {
924-
"identifier": {
925-
"$ref": "#/components/schemas/type_uuid"
926-
},
927-
"description": {
928-
"type": "string"
929-
},
930-
"mime_type": {
931-
"type": "string"
932-
},
933-
"artifact_url": {
934-
"type": "string",
935-
"format": "uri"
936-
},
937-
"artifact_size_in_bytes": {
938-
"type": "integer",
939-
"format": "int64"
940-
},
941-
"artifact_checksum": {
942-
"type": "string",
943-
"description": "The checksum value"
984+
"allOf": [
985+
{
986+
"$ref": "#/components/schemas/type_pagination_details"
944987
},
945-
"artifact_checksum_type": {
946-
"type": "string",
947-
"description": "The algorithm used to generate the checksum",
948-
"enum": [
949-
"SHA512",
950-
"SHA384",
951-
"SHA256",
952-
"SHA224",
953-
"SHA1",
954-
"MD5",
955-
"BLAKE2b-512",
956-
"BLAKE2s-256",
957-
"BLAKE3"
958-
],
959-
"default": "SHA256"
988+
{
989+
"type": "object",
990+
"properties": {
991+
"content": {
992+
"type": "array",
993+
"items": {
994+
"$ref": "#/components/schemas/tea_product"
995+
}
996+
}
997+
}
960998
}
961-
}
999+
]
9621000
},
9631001
"tea_product": {
9641002
"allOf": [
965-
{ "$ref": "#/components/schemas/base_product_fields" },
1003+
{
1004+
"$ref": "#/components/schemas/base_product_fields"
1005+
},
9661006
{
9671007
"type": "object",
9681008
"properties": {
@@ -977,13 +1017,18 @@
9771017
"description": "Array of UUIDs referencing TEA Leaf entries"
9781018
}
9791019
},
980-
"required": ["identifier", "product_name"]
1020+
"required": [
1021+
"identifier",
1022+
"product_name"
1023+
]
9811024
}
9821025
]
9831026
},
9841027
"tea_leaf": {
9851028
"allOf": [
986-
{ "$ref": "#/components/schemas/base_versioned_product" },
1029+
{
1030+
"$ref": "#/components/schemas/base_versioned_product"
1031+
},
9871032
{
9881033
"type": "object",
9891034
"properties": {
@@ -1304,31 +1349,6 @@
13041349
"format": "uuid"
13051350
}
13061351
},
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-
},
13321352
"parameters": {
13331353
"page-offset": {
13341354
"name": "page-offset",
@@ -1435,54 +1455,17 @@
14351455
"scheme": "basic"
14361456
}
14371457
},
1438-
"security_requirements": {
1439-
"standard_auth": [
1440-
{
1441-
"bearerAuth": []
1442-
},
1443-
{
1444-
"basicAuth": []
1445-
}
1446-
]
1447-
},
14481458
"responses": {
1449-
"standard_errors": {
1450-
"400": {
1451-
"description": "Invalid request body",
1452-
"content": {
1453-
"application/json": {}
1454-
}
1455-
},
1456-
"401": {
1457-
"$ref": "#/components/responses/401-unauthorized"
1458-
},
1459-
"404": {
1460-
"$ref": "#/components/responses/404-object-by-id-not-found"
1459+
"404-object-by-id-not-found": {
1460+
"description": "Object requested by identifier not found",
1461+
"content": {
1462+
"application/json": {}
14611463
}
14621464
},
1463-
"standard_delete": {
1464-
"204": {
1465-
"description": "Resource successfully deleted"
1466-
}
1467-
}
1468-
},
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-
},
1479-
"operations": {
1480-
"standard_delete": {
1481-
"responses": {
1482-
"$ref": "#/components/responses/standard_delete"
1483-
},
1484-
"security": {
1485-
"$ref": "#/components/security_requirements/standard_auth"
1465+
"401-unauthorized": {
1466+
"description": "Authentication required",
1467+
"content": {
1468+
"application/json": {}
14861469
}
14871470
}
14881471
}

0 commit comments

Comments
 (0)