From 1ea0db3f083028d692544e08ac8d41df3a7c2f4c Mon Sep 17 00:00:00 2001 From: Inian Date: Fri, 19 Aug 2022 15:42:31 +0800 Subject: [PATCH 1/5] update storage spec --- apps/reference/_storage/generated/usage.mdx | 99 ++++++++---- spec/storage_v0_openapi.json | 153 ++++++++++++------ .../storage_v0_openapi_deparsed.json | 99 ++++++++---- 3 files changed, 234 insertions(+), 117 deletions(-) diff --git a/apps/reference/_storage/generated/usage.mdx b/apps/reference/_storage/generated/usage.mdx index 31d4fae954e..ff00cff91d6 100644 --- a/apps/reference/_storage/generated/usage.mdx +++ b/apps/reference/_storage/generated/usage.mdx @@ -113,7 +113,7 @@ DELETE /object/{bucketName}/{wildcard} -Default Response +Successful response @@ -121,6 +121,7 @@ Default Response ```json { "schema": { + "description": "Successful response", "type": "object", "properties": { "message": { @@ -139,7 +140,7 @@ Default Response -Default Response +Error response @@ -147,6 +148,7 @@ Default Response ```json { "schema": { + "description": "Error response", "type": "object", "properties": { "statusCode": { @@ -268,7 +270,7 @@ PUT /object/{bucketName}/{wildcard} -Default Response +Successful response @@ -276,6 +278,7 @@ Default Response ```json { "schema": { + "description": "Successful response", "type": "object", "properties": { "Key": { @@ -297,7 +300,7 @@ Default Response -Default Response +Error response @@ -305,6 +308,7 @@ Default Response ```json { "schema": { + "description": "Error response", "type": "object", "properties": { "statusCode": { @@ -426,7 +430,7 @@ POST /object/{bucketName}/{wildcard} -Default Response +Successful response @@ -434,6 +438,7 @@ Default Response ```json { "schema": { + "description": "Successful response", "type": "object", "properties": { "Key": { @@ -455,7 +460,7 @@ Default Response -Default Response +Error response @@ -463,6 +468,7 @@ Default Response ```json { "schema": { + "description": "Error response", "type": "object", "properties": { "statusCode": { @@ -593,7 +599,7 @@ DELETE /object/{bucketName} -Default Response +Successful response @@ -601,6 +607,7 @@ Default Response ```json { "schema": { + "description": "Successful response", "type": "array", "items": { "type": "object", @@ -730,7 +737,7 @@ Default Response -Default Response +Error response @@ -738,6 +745,7 @@ Default Response ```json { "schema": { + "description": "Error response", "type": "object", "properties": { "statusCode": { @@ -859,7 +867,7 @@ GET /object/authenticated/{bucketName}/{wildcard} -Default Response +Error response @@ -867,6 +875,7 @@ Default Response ```json { "schema": { + "description": "Error response", "type": "object", "properties": { "statusCode": { @@ -1008,7 +1017,7 @@ POST /object/sign/{bucketName}/{wildcard} -Default Response +Successful response @@ -1016,6 +1025,7 @@ Default Response ```json { "schema": { + "description": "Successful response", "type": "object", "properties": { "signedURL": { @@ -1037,7 +1047,7 @@ Default Response -Default Response +Error response @@ -1045,6 +1055,7 @@ Default Response ```json { "schema": { + "description": "Error response", "type": "object", "properties": { "statusCode": { @@ -1144,7 +1155,7 @@ GET /object/sign/{bucketName}/{wildcard} -Default Response +Error response @@ -1152,6 +1163,7 @@ Default Response ```json { "schema": { + "description": "Error response", "type": "object", "properties": { "statusCode": { @@ -1288,7 +1300,7 @@ POST /object/sign/{bucketName} -Default Response +Successful response @@ -1296,6 +1308,7 @@ Default Response ```json { "schema": { + "description": "Successful response", "type": "array", "items": { "type": "object", @@ -1336,7 +1349,7 @@ Default Response -Default Response +Error response @@ -1344,6 +1357,7 @@ Default Response ```json { "schema": { + "description": "Error response", "type": "object", "properties": { "statusCode": { @@ -1454,7 +1468,7 @@ POST /object/move -Default Response +Successful response @@ -1462,6 +1476,7 @@ Default Response ```json { "schema": { + "description": "Successful response", "type": "object", "properties": { "message": { @@ -1483,7 +1498,7 @@ Default Response -Default Response +Error response @@ -1491,6 +1506,7 @@ Default Response ```json { "schema": { + "description": "Error response", "type": "object", "properties": { "statusCode": { @@ -1651,7 +1667,7 @@ POST /object/list/{bucketName} -Default Response +Successful response @@ -1659,6 +1675,7 @@ Default Response ```json { "schema": { + "description": "Successful response", "type": "array", "items": { "type": "object", @@ -1787,7 +1804,7 @@ Default Response -Default Response +Error response @@ -1795,6 +1812,7 @@ Default Response ```json { "schema": { + "description": "Error response", "type": "object", "properties": { "statusCode": { @@ -1905,7 +1923,7 @@ POST /object/copy -Default Response +Successful response @@ -1913,6 +1931,7 @@ Default Response ```json { "schema": { + "description": "Successful response", "type": "object", "properties": { "Key": { @@ -1934,7 +1953,7 @@ Default Response -Default Response +Error response @@ -1942,6 +1961,7 @@ Default Response ```json { "schema": { + "description": "Error response", "type": "object", "properties": { "statusCode": { @@ -2041,7 +2061,7 @@ GET /object/public/{bucketName}/{wildcard} -Default Response +Error response @@ -2049,6 +2069,7 @@ Default Response ```json { "schema": { + "description": "Error response", "type": "object", "properties": { "statusCode": { @@ -2164,7 +2185,7 @@ POST /bucket/ -Default Response +Successful response @@ -2172,6 +2193,7 @@ Default Response ```json { "schema": { + "description": "Successful response", "type": "object", "properties": { "name": { @@ -2193,7 +2215,7 @@ Default Response -Default Response +Error response @@ -2201,6 +2223,7 @@ Default Response ```json { "schema": { + "description": "Error response", "type": "object", "properties": { "statusCode": { @@ -2282,7 +2305,7 @@ GET /bucket/ -Default Response +Successful response @@ -2290,6 +2313,7 @@ Default Response ```json { "schema": { + "description": "Successful response", "type": "array", "items": { "type": "object", @@ -2356,7 +2380,7 @@ Default Response -Default Response +Error response @@ -2364,6 +2388,7 @@ Default Response ```json { "schema": { + "description": "Error response", "type": "object", "properties": { "statusCode": { @@ -2468,7 +2493,7 @@ POST /bucket/{bucketId}/empty -Default Response +Successful response @@ -2476,6 +2501,7 @@ Default Response ```json { "schema": { + "description": "Successful response", "type": "object", "properties": { "message": { @@ -2494,7 +2520,7 @@ Default Response -Default Response +Error response @@ -2502,6 +2528,7 @@ Default Response ```json { "schema": { + "description": "Error response", "type": "object", "properties": { "statusCode": { @@ -2606,7 +2633,7 @@ GET /bucket/{bucketId} -Default Response +Successful response @@ -2614,6 +2641,7 @@ Default Response ```json { "schema": { + "description": "Successful response", "type": "object", "properties": { "id": { @@ -2665,7 +2693,7 @@ Default Response -Default Response +Error response @@ -2673,6 +2701,7 @@ Default Response ```json { "schema": { + "description": "Error response", "type": "object", "properties": { "statusCode": { @@ -2770,7 +2799,7 @@ PUT /bucket/{bucketId} -Default Response +Successful response @@ -2778,6 +2807,7 @@ Default Response ```json { "schema": { + "description": "Successful response", "type": "object", "properties": { "message": { @@ -2799,7 +2829,7 @@ Default Response -Default Response +Error response @@ -2807,6 +2837,7 @@ Default Response ```json { "schema": { + "description": "Error response", "type": "object", "properties": { "statusCode": { @@ -2911,7 +2942,7 @@ DELETE /bucket/{bucketId} -Default Response +Successful response @@ -2919,6 +2950,7 @@ Default Response ```json { "schema": { + "description": "Successful response", "type": "object", "properties": { "message": { @@ -2937,7 +2969,7 @@ Default Response -Default Response +Error response @@ -2945,6 +2977,7 @@ Default Response ```json { "schema": { + "description": "Error response", "type": "object", "properties": { "statusCode": { diff --git a/spec/storage_v0_openapi.json b/spec/storage_v0_openapi.json index 252aeaabdbb..db828eae781 100644 --- a/spec/storage_v0_openapi.json +++ b/spec/storage_v0_openapi.json @@ -56,10 +56,11 @@ ], "responses": { "200": { - "description": "Default Response", + "description": "Successful response", "content": { "application/json": { "schema": { + "description": "Successful response", "type": "object", "properties": { "name": { "type": "string", "example": "avatars" } }, "required": ["name"] @@ -68,9 +69,11 @@ } }, "4XX": { - "description": "Default Response", + "description": "Error response", "content": { - "application/json": { "schema": { "$ref": "#/components/schemas/def-1" } } + "application/json": { + "schema": { "description": "Error response", "$ref": "#/components/schemas/def-1" } + } } } } @@ -88,10 +91,11 @@ ], "responses": { "200": { - "description": "Default Response", + "description": "Successful response", "content": { "application/json": { "schema": { + "description": "Successful response", "type": "array", "items": { "type": "object", @@ -137,9 +141,11 @@ } }, "4XX": { - "description": "Default Response", + "description": "Error response", "content": { - "application/json": { "schema": { "$ref": "#/components/schemas/def-1" } } + "application/json": { + "schema": { "description": "Error response", "$ref": "#/components/schemas/def-1" } + } } } } @@ -166,10 +172,11 @@ ], "responses": { "200": { - "description": "Default Response", + "description": "Successful response", "content": { "application/json": { "schema": { + "description": "Successful response", "type": "object", "properties": { "message": { "type": "string", "example": "Successfully emptied" } @@ -179,9 +186,11 @@ } }, "4XX": { - "description": "Default Response", + "description": "Error response", "content": { - "application/json": { "schema": { "$ref": "#/components/schemas/def-1" } } + "application/json": { + "schema": { "description": "Error response", "$ref": "#/components/schemas/def-1" } + } } } } @@ -208,10 +217,11 @@ ], "responses": { "200": { - "description": "Default Response", + "description": "Successful response", "content": { "application/json": { "schema": { + "description": "Successful response", "type": "object", "properties": { "id": { "type": "string" }, @@ -242,9 +252,11 @@ } }, "4XX": { - "description": "Default Response", + "description": "Error response", "content": { - "application/json": { "schema": { "$ref": "#/components/schemas/def-1" } } + "application/json": { + "schema": { "description": "Error response", "$ref": "#/components/schemas/def-1" } + } } } } @@ -272,10 +284,11 @@ ], "responses": { "200": { - "description": "Default Response", + "description": "Successful response", "content": { "application/json": { "schema": { + "description": "Successful response", "type": "object", "properties": { "message": { "type": "string", "example": "Successfully updated" } @@ -286,9 +299,11 @@ } }, "4XX": { - "description": "Default Response", + "description": "Error response", "content": { - "application/json": { "schema": { "$ref": "#/components/schemas/def-1" } } + "application/json": { + "schema": { "description": "Error response", "$ref": "#/components/schemas/def-1" } + } } } } @@ -313,10 +328,11 @@ ], "responses": { "200": { - "description": "Default Response", + "description": "Successful response", "content": { "application/json": { "schema": { + "description": "Successful response", "type": "object", "properties": { "message": { "type": "string", "example": "Successfully deleted" } @@ -326,9 +342,11 @@ } }, "4XX": { - "description": "Default Response", + "description": "Error response", "content": { - "application/json": { "schema": { "$ref": "#/components/schemas/def-1" } } + "application/json": { + "schema": { "description": "Error response", "$ref": "#/components/schemas/def-1" } + } } } } @@ -362,10 +380,11 @@ ], "responses": { "200": { - "description": "Default Response", + "description": "Successful response", "content": { "application/json": { "schema": { + "description": "Successful response", "type": "object", "properties": { "message": { "type": "string", "example": "Successfully deleted" } @@ -375,9 +394,11 @@ } }, "4XX": { - "description": "Default Response", + "description": "Error response", "content": { - "application/json": { "schema": { "$ref": "#/components/schemas/def-1" } } + "application/json": { + "schema": { "description": "Error response", "$ref": "#/components/schemas/def-1" } + } } } } @@ -444,10 +465,11 @@ ], "responses": { "200": { - "description": "Default Response", + "description": "Successful response", "content": { "application/json": { "schema": { + "description": "Successful response", "type": "object", "properties": { "Key": { "type": "string", "example": "projectref/avatars/folder/cat.png" } @@ -458,9 +480,11 @@ } }, "4XX": { - "description": "Default Response", + "description": "Error response", "content": { - "application/json": { "schema": { "$ref": "#/components/schemas/def-1" } } + "application/json": { + "schema": { "description": "Error response", "$ref": "#/components/schemas/def-1" } + } } } } @@ -492,10 +516,11 @@ ], "responses": { "200": { - "description": "Default Response", + "description": "Successful response", "content": { "application/json": { "schema": { + "description": "Successful response", "type": "object", "properties": { "Key": { "type": "string", "example": "avatars/folder/cat.png" } @@ -506,9 +531,11 @@ } }, "4XX": { - "description": "Default Response", + "description": "Error response", "content": { - "application/json": { "schema": { "$ref": "#/components/schemas/def-1" } } + "application/json": { + "schema": { "description": "Error response", "$ref": "#/components/schemas/def-1" } + } } } } @@ -554,10 +581,11 @@ ], "responses": { "200": { - "description": "Default Response", + "description": "Successful response", "content": { "application/json": { "schema": { + "description": "Successful response", "type": "array", "items": { "type": "object", @@ -615,9 +643,11 @@ } }, "4XX": { - "description": "Default Response", + "description": "Error response", "content": { - "application/json": { "schema": { "$ref": "#/components/schemas/def-1" } } + "application/json": { + "schema": { "description": "Error response", "$ref": "#/components/schemas/def-1" } + } } } } @@ -651,9 +681,11 @@ ], "responses": { "4XX": { - "description": "Default Response", + "description": "Error response", "content": { - "application/json": { "schema": { "$ref": "#/components/schemas/def-1" } } + "application/json": { + "schema": { "$ref": "#/components/schemas/def-1", "description": "Error response" } + } } } } @@ -701,10 +733,11 @@ ], "responses": { "200": { - "description": "Default Response", + "description": "Successful response", "content": { "application/json": { "schema": { + "description": "Successful response", "type": "object", "properties": { "signedURL": { @@ -718,9 +751,11 @@ } }, "4XX": { - "description": "Default Response", + "description": "Error response", "content": { - "application/json": { "schema": { "$ref": "#/components/schemas/def-1" } } + "application/json": { + "schema": { "description": "Error response", "$ref": "#/components/schemas/def-1" } + } } } } @@ -756,9 +791,11 @@ ], "responses": { "4XX": { - "description": "Default Response", + "description": "Error response", "content": { - "application/json": { "schema": { "$ref": "#/components/schemas/def-1" } } + "application/json": { + "schema": { "$ref": "#/components/schemas/def-1", "description": "Error response" } + } } } } @@ -805,10 +842,11 @@ ], "responses": { "200": { - "description": "Default Response", + "description": "Successful response", "content": { "application/json": { "schema": { + "description": "Successful response", "type": "array", "items": { "type": "object", @@ -830,9 +868,11 @@ } }, "4XX": { - "description": "Default Response", + "description": "Error response", "content": { - "application/json": { "schema": { "$ref": "#/components/schemas/def-1" } } + "application/json": { + "schema": { "description": "Error response", "$ref": "#/components/schemas/def-1" } + } } } } @@ -868,10 +908,11 @@ ], "responses": { "200": { - "description": "Default Response", + "description": "Successful response", "content": { "application/json": { "schema": { + "description": "Successful response", "type": "object", "properties": { "message": { "type": "string", "example": "Successfully moved" } @@ -882,9 +923,11 @@ } }, "4XX": { - "description": "Default Response", + "description": "Error response", "content": { - "application/json": { "schema": { "$ref": "#/components/schemas/def-1" } } + "application/json": { + "schema": { "description": "Error response", "$ref": "#/components/schemas/def-1" } + } } } } @@ -933,10 +976,11 @@ ], "responses": { "200": { - "description": "Default Response", + "description": "Successful response", "content": { "application/json": { "schema": { + "description": "Successful response", "type": "array", "items": { "type": "object", @@ -993,9 +1037,11 @@ } }, "4XX": { - "description": "Default Response", + "description": "Error response", "content": { - "application/json": { "schema": { "$ref": "#/components/schemas/def-1" } } + "application/json": { + "schema": { "description": "Error response", "$ref": "#/components/schemas/def-1" } + } } } } @@ -1031,10 +1077,11 @@ ], "responses": { "200": { - "description": "Default Response", + "description": "Successful response", "content": { "application/json": { "schema": { + "description": "Successful response", "type": "object", "properties": { "Key": { "type": "string", "example": "folder/destination.png" } @@ -1045,9 +1092,11 @@ } }, "4XX": { - "description": "Default Response", + "description": "Error response", "content": { - "application/json": { "schema": { "$ref": "#/components/schemas/def-1" } } + "application/json": { + "schema": { "description": "Error response", "$ref": "#/components/schemas/def-1" } + } } } } @@ -1075,9 +1124,11 @@ ], "responses": { "4XX": { - "description": "Default Response", + "description": "Error response", "content": { - "application/json": { "schema": { "$ref": "#/components/schemas/def-1" } } + "application/json": { + "schema": { "$ref": "#/components/schemas/def-1", "description": "Error response" } + } } } } diff --git a/spec/transforms/storage_v0_openapi_deparsed.json b/spec/transforms/storage_v0_openapi_deparsed.json index 4a115fa1a40..008ce025124 100644 --- a/spec/transforms/storage_v0_openapi_deparsed.json +++ b/spec/transforms/storage_v0_openapi_deparsed.json @@ -87,10 +87,11 @@ ], "responses": { "200": { - "description": "Default Response", + "description": "Successful response", "content": { "application/json": { "schema": { + "description": "Successful response", "type": "object", "properties": { "name": { @@ -106,10 +107,11 @@ } }, "4XX": { - "description": "Default Response", + "description": "Error response", "content": { "application/json": { "schema": { + "description": "Error response", "type": "object", "properties": { "statusCode": { @@ -151,10 +153,11 @@ ], "responses": { "200": { - "description": "Default Response", + "description": "Successful response", "content": { "application/json": { "schema": { + "description": "Successful response", "type": "array", "items": { "type": "object", @@ -215,10 +218,11 @@ } }, "4XX": { - "description": "Default Response", + "description": "Error response", "content": { "application/json": { "schema": { + "description": "Error response", "type": "object", "properties": { "statusCode": { @@ -272,10 +276,11 @@ ], "responses": { "200": { - "description": "Default Response", + "description": "Successful response", "content": { "application/json": { "schema": { + "description": "Successful response", "type": "object", "properties": { "message": { @@ -288,10 +293,11 @@ } }, "4XX": { - "description": "Default Response", + "description": "Error response", "content": { "application/json": { "schema": { + "description": "Error response", "type": "object", "properties": { "statusCode": { @@ -345,10 +351,11 @@ ], "responses": { "200": { - "description": "Default Response", + "description": "Successful response", "content": { "application/json": { "schema": { + "description": "Successful response", "type": "object", "properties": { "id": { @@ -394,10 +401,11 @@ } }, "4XX": { - "description": "Default Response", + "description": "Error response", "content": { "application/json": { "schema": { + "description": "Error response", "type": "object", "properties": { "statusCode": { @@ -454,10 +462,11 @@ ], "responses": { "200": { - "description": "Default Response", + "description": "Successful response", "content": { "application/json": { "schema": { + "description": "Successful response", "type": "object", "properties": { "message": { @@ -473,10 +482,11 @@ } }, "4XX": { - "description": "Default Response", + "description": "Error response", "content": { "application/json": { "schema": { + "description": "Error response", "type": "object", "properties": { "statusCode": { @@ -528,10 +538,11 @@ ], "responses": { "200": { - "description": "Default Response", + "description": "Successful response", "content": { "application/json": { "schema": { + "description": "Successful response", "type": "object", "properties": { "message": { @@ -544,10 +555,11 @@ } }, "4XX": { - "description": "Default Response", + "description": "Error response", "content": { "application/json": { "schema": { + "description": "Error response", "type": "object", "properties": { "statusCode": { @@ -611,10 +623,11 @@ ], "responses": { "200": { - "description": "Default Response", + "description": "Successful response", "content": { "application/json": { "schema": { + "description": "Successful response", "type": "object", "properties": { "message": { @@ -627,10 +640,11 @@ } }, "4XX": { - "description": "Default Response", + "description": "Error response", "content": { "application/json": { "schema": { + "description": "Error response", "type": "object", "properties": { "statusCode": { @@ -758,10 +772,11 @@ ], "responses": { "200": { - "description": "Default Response", + "description": "Successful response", "content": { "application/json": { "schema": { + "description": "Successful response", "type": "object", "properties": { "Key": { @@ -777,10 +792,11 @@ } }, "4XX": { - "description": "Default Response", + "description": "Error response", "content": { "application/json": { "schema": { + "description": "Error response", "type": "object", "properties": { "statusCode": { @@ -842,10 +858,11 @@ ], "responses": { "200": { - "description": "Default Response", + "description": "Successful response", "content": { "application/json": { "schema": { + "description": "Successful response", "type": "object", "properties": { "Key": { @@ -861,10 +878,11 @@ } }, "4XX": { - "description": "Default Response", + "description": "Error response", "content": { "application/json": { "schema": { + "description": "Error response", "type": "object", "properties": { "statusCode": { @@ -944,10 +962,11 @@ ], "responses": { "200": { - "description": "Default Response", + "description": "Successful response", "content": { "application/json": { "schema": { + "description": "Successful response", "type": "array", "items": { "type": "object", @@ -1071,10 +1090,11 @@ } }, "4XX": { - "description": "Default Response", + "description": "Error response", "content": { "application/json": { "schema": { + "description": "Error response", "type": "object", "properties": { "statusCode": { @@ -1138,10 +1158,11 @@ ], "responses": { "4XX": { - "description": "Default Response", + "description": "Error response", "content": { "application/json": { "schema": { + "description": "Error response", "type": "object", "properties": { "statusCode": { @@ -1225,10 +1246,11 @@ ], "responses": { "200": { - "description": "Default Response", + "description": "Successful response", "content": { "application/json": { "schema": { + "description": "Successful response", "type": "object", "properties": { "signedURL": { @@ -1244,10 +1266,11 @@ } }, "4XX": { - "description": "Default Response", + "description": "Error response", "content": { "application/json": { "schema": { + "description": "Error response", "type": "object", "properties": { "statusCode": { @@ -1311,10 +1334,11 @@ ], "responses": { "4XX": { - "description": "Default Response", + "description": "Error response", "content": { "application/json": { "schema": { + "description": "Error response", "type": "object", "properties": { "statusCode": { @@ -1400,10 +1424,11 @@ ], "responses": { "200": { - "description": "Default Response", + "description": "Successful response", "content": { "application/json": { "schema": { + "description": "Successful response", "type": "array", "items": { "type": "object", @@ -1438,10 +1463,11 @@ } }, "4XX": { - "description": "Default Response", + "description": "Error response", "content": { "application/json": { "schema": { + "description": "Error response", "type": "object", "properties": { "statusCode": { @@ -1514,10 +1540,11 @@ ], "responses": { "200": { - "description": "Default Response", + "description": "Successful response", "content": { "application/json": { "schema": { + "description": "Successful response", "type": "object", "properties": { "message": { @@ -1533,10 +1560,11 @@ } }, "4XX": { - "description": "Default Response", + "description": "Error response", "content": { "application/json": { "schema": { + "description": "Error response", "type": "object", "properties": { "statusCode": { @@ -1644,10 +1672,11 @@ ], "responses": { "200": { - "description": "Default Response", + "description": "Successful response", "content": { "application/json": { "schema": { + "description": "Successful response", "type": "array", "items": { "type": "object", @@ -1770,10 +1799,11 @@ } }, "4XX": { - "description": "Default Response", + "description": "Error response", "content": { "application/json": { "schema": { + "description": "Error response", "type": "object", "properties": { "statusCode": { @@ -1846,10 +1876,11 @@ ], "responses": { "200": { - "description": "Default Response", + "description": "Successful response", "content": { "application/json": { "schema": { + "description": "Successful response", "type": "object", "properties": { "Key": { @@ -1865,10 +1896,11 @@ } }, "4XX": { - "description": "Default Response", + "description": "Error response", "content": { "application/json": { "schema": { + "description": "Error response", "type": "object", "properties": { "statusCode": { @@ -1924,10 +1956,11 @@ ], "responses": { "4XX": { - "description": "Default Response", + "description": "Error response", "content": { "application/json": { "schema": { + "description": "Error response", "type": "object", "properties": { "statusCode": { From 50a35f647c12a9aec3e9f99bf861dd63ac8ead38 Mon Sep 17 00:00:00 2001 From: Inian Date: Fri, 19 Aug 2022 15:42:39 +0800 Subject: [PATCH 2/5] update openapi spec --- spec/api_v0_openapi.json | 61 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) diff --git a/spec/api_v0_openapi.json b/spec/api_v0_openapi.json index 6180bba0f14..d19ff69845d 100644 --- a/spec/api_v0_openapi.json +++ b/spec/api_v0_openapi.json @@ -356,6 +356,62 @@ "tags": ["projects"], "security": [{ "bearer": [] }] } + }, + "/v1/projects/{ref}/pgsodium": { + "get": { + "operationId": "getConfig", + "summary": "Gets project's pgsodium config", + "parameters": [ + { + "name": "ref", + "required": true, + "in": "path", + "description": "Project ref", + "schema": { "minLength": 20, "maxLength": 20, "type": "string" } + } + ], + "responses": { + "200": { + "description": "", + "content": { "application/json": { "schema": { "type": "object" } } } + }, + "403": { "description": "" }, + "500": { "description": "Failed to retrieve project's pgsodium config" } + }, + "tags": ["pgsodium (beta)"], + "security": [{ "bearer": [] }] + }, + "put": { + "operationId": "updateConfig", + "summary": "Updates project's pgsodium config. Updating the root_key can cause all data encrypted with the older key to become inaccessible.", + "parameters": [ + { + "name": "ref", + "required": true, + "in": "path", + "description": "Project ref", + "schema": { "minLength": 20, "maxLength": 20, "type": "string" } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/UpdatePgsodiumConfigBody" } + } + } + }, + "responses": { + "200": { + "description": "", + "content": { "application/json": { "schema": { "type": "object" } } } + }, + "403": { "description": "" }, + "500": { "description": "Failed to update project's pgsodium config" } + }, + "tags": ["pgsodium (beta)"], + "security": [{ "bearer": [] }] + } } }, "info": { "title": "Supabase API (v1)", "description": "", "version": "1.0.0", "contact": {} }, @@ -474,6 +530,11 @@ "value": { "type": "string", "pattern": {} } }, "required": ["name", "value"] + }, + "UpdatePgsodiumConfigBody": { + "type": "object", + "properties": { "root_key": { "type": "string" } }, + "required": ["root_key"] } } } From aad9b6632a4709fc83d1f926767afcc8a2e1748d Mon Sep 17 00:00:00 2001 From: Inian Date: Fri, 19 Aug 2022 15:42:50 +0800 Subject: [PATCH 3/5] prettify cli spec --- spec/cli_v1_commands.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/cli_v1_commands.yaml b/spec/cli_v1_commands.yaml index 46305027576..e3d03ff6373 100644 --- a/spec/cli_v1_commands.yaml +++ b/spec/cli_v1_commands.yaml @@ -1,4 +1,4 @@ -clispec: "001" +clispec: '001' info: id: cli version: 1.0.0 From 7d957bd9ecb62e76f9471a47e91da21934ef7561 Mon Sep 17 00:00:00 2001 From: Inian Date: Fri, 19 Aug 2022 15:50:52 +0800 Subject: [PATCH 4/5] update storage docs --- apps/reference/_storage/generated/usage.mdx | 2 +- spec/storage_v0_openapi.json | 2 +- spec/transforms/storage_v0_openapi_deparsed.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/reference/_storage/generated/usage.mdx b/apps/reference/_storage/generated/usage.mdx index ff00cff91d6..71427efd20f 100644 --- a/apps/reference/_storage/generated/usage.mdx +++ b/apps/reference/_storage/generated/usage.mdx @@ -3019,7 +3019,7 @@ Deprecated end-points -### Get object (deprecated) {#get-object-deprecated} +### Get object {#get-object} ``` GET /object/{bucketName}/{wildcard} diff --git a/spec/storage_v0_openapi.json b/spec/storage_v0_openapi.json index db828eae781..0d87af1ff92 100644 --- a/spec/storage_v0_openapi.json +++ b/spec/storage_v0_openapi.json @@ -404,7 +404,7 @@ } }, "get": { - "summary": "Get object (deprecated)", + "summary": "Get object", "tags": ["deprecated"], "description": "use GET /object/authenticated/{bucketName} instead", "parameters": [ diff --git a/spec/transforms/storage_v0_openapi_deparsed.json b/spec/transforms/storage_v0_openapi_deparsed.json index 008ce025124..80e308587e0 100644 --- a/spec/transforms/storage_v0_openapi_deparsed.json +++ b/spec/transforms/storage_v0_openapi_deparsed.json @@ -670,7 +670,7 @@ } }, "get": { - "summary": "Get object (deprecated)", + "summary": "Get object", "tags": [ "deprecated" ], From 97a056fe9ee612cddea3bdae10532074256624e6 Mon Sep 17 00:00:00 2001 From: Inian Date: Fri, 19 Aug 2022 16:48:41 +0800 Subject: [PATCH 5/5] update storage spec --- spec/storage_v0_openapi.json | 58 +++++++++++++------ .../storage_v0_openapi_deparsed.json | 54 +++++++++++------ 2 files changed, 76 insertions(+), 36 deletions(-) diff --git a/spec/storage_v0_openapi.json b/spec/storage_v0_openapi.json index 0d87af1ff92..452022e16a8 100644 --- a/spec/storage_v0_openapi.json +++ b/spec/storage_v0_openapi.json @@ -9,7 +9,12 @@ "schemas": { "def-0": { "type": "object", - "properties": { "authorization": { "type": "string" } }, + "properties": { + "authorization": { + "type": "string", + "example": "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZS1kZW1vIiwicm9sZSI6ImFub24ifQ.625_WdcF3KHqz5amU0x2X5WWHP-OEs_4qj0ssLNHzTs" + } + }, "required": ["authorization"], "title": "authSchema" }, @@ -51,7 +56,8 @@ "in": "header", "name": "authorization", "required": true, - "schema": { "type": "string" } + "schema": { "type": "string" }, + "example": "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZS1kZW1vIiwicm9sZSI6ImFub24ifQ.625_WdcF3KHqz5amU0x2X5WWHP-OEs_4qj0ssLNHzTs" } ], "responses": { @@ -86,7 +92,8 @@ "in": "header", "name": "authorization", "required": true, - "schema": { "type": "string" } + "schema": { "type": "string" }, + "example": "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZS1kZW1vIiwicm9sZSI6ImFub24ifQ.625_WdcF3KHqz5amU0x2X5WWHP-OEs_4qj0ssLNHzTs" } ], "responses": { @@ -167,7 +174,8 @@ "in": "header", "name": "authorization", "required": true, - "schema": { "type": "string" } + "schema": { "type": "string" }, + "example": "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZS1kZW1vIiwicm9sZSI6ImFub24ifQ.625_WdcF3KHqz5amU0x2X5WWHP-OEs_4qj0ssLNHzTs" } ], "responses": { @@ -212,7 +220,8 @@ "in": "header", "name": "authorization", "required": true, - "schema": { "type": "string" } + "schema": { "type": "string" }, + "example": "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZS1kZW1vIiwicm9sZSI6ImFub24ifQ.625_WdcF3KHqz5amU0x2X5WWHP-OEs_4qj0ssLNHzTs" } ], "responses": { @@ -279,7 +288,8 @@ "in": "header", "name": "authorization", "required": true, - "schema": { "type": "string" } + "schema": { "type": "string" }, + "example": "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZS1kZW1vIiwicm9sZSI6ImFub24ifQ.625_WdcF3KHqz5amU0x2X5WWHP-OEs_4qj0ssLNHzTs" } ], "responses": { @@ -323,7 +333,8 @@ "in": "header", "name": "authorization", "required": true, - "schema": { "type": "string" } + "schema": { "type": "string" }, + "example": "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZS1kZW1vIiwicm9sZSI6ImFub24ifQ.625_WdcF3KHqz5amU0x2X5WWHP-OEs_4qj0ssLNHzTs" } ], "responses": { @@ -375,7 +386,8 @@ "in": "header", "name": "authorization", "required": true, - "schema": { "type": "string" } + "schema": { "type": "string" }, + "example": "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZS1kZW1vIiwicm9sZSI6ImFub24ifQ.625_WdcF3KHqz5amU0x2X5WWHP-OEs_4qj0ssLNHzTs" } ], "responses": { @@ -426,7 +438,8 @@ "in": "header", "name": "authorization", "required": true, - "schema": { "type": "string" } + "schema": { "type": "string" }, + "example": "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZS1kZW1vIiwicm9sZSI6ImFub24ifQ.625_WdcF3KHqz5amU0x2X5WWHP-OEs_4qj0ssLNHzTs" } ], "responses": { @@ -460,7 +473,8 @@ "in": "header", "name": "authorization", "required": true, - "schema": { "type": "string" } + "schema": { "type": "string" }, + "example": "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZS1kZW1vIiwicm9sZSI6ImFub24ifQ.625_WdcF3KHqz5amU0x2X5WWHP-OEs_4qj0ssLNHzTs" } ], "responses": { @@ -511,7 +525,8 @@ "in": "header", "name": "authorization", "required": true, - "schema": { "type": "string" } + "schema": { "type": "string" }, + "example": "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZS1kZW1vIiwicm9sZSI6ImFub24ifQ.625_WdcF3KHqz5amU0x2X5WWHP-OEs_4qj0ssLNHzTs" } ], "responses": { @@ -576,7 +591,8 @@ "in": "header", "name": "authorization", "required": true, - "schema": { "type": "string" } + "schema": { "type": "string" }, + "example": "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZS1kZW1vIiwicm9sZSI6ImFub24ifQ.625_WdcF3KHqz5amU0x2X5WWHP-OEs_4qj0ssLNHzTs" } ], "responses": { @@ -676,7 +692,8 @@ "in": "header", "name": "authorization", "required": true, - "schema": { "type": "string" } + "schema": { "type": "string" }, + "example": "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZS1kZW1vIiwicm9sZSI6ImFub24ifQ.625_WdcF3KHqz5amU0x2X5WWHP-OEs_4qj0ssLNHzTs" } ], "responses": { @@ -728,7 +745,8 @@ "in": "header", "name": "authorization", "required": true, - "schema": { "type": "string" } + "schema": { "type": "string" }, + "example": "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZS1kZW1vIiwicm9sZSI6ImFub24ifQ.625_WdcF3KHqz5amU0x2X5WWHP-OEs_4qj0ssLNHzTs" } ], "responses": { @@ -837,7 +855,8 @@ "in": "header", "name": "authorization", "required": true, - "schema": { "type": "string" } + "schema": { "type": "string" }, + "example": "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZS1kZW1vIiwicm9sZSI6ImFub24ifQ.625_WdcF3KHqz5amU0x2X5WWHP-OEs_4qj0ssLNHzTs" } ], "responses": { @@ -903,7 +922,8 @@ "in": "header", "name": "authorization", "required": true, - "schema": { "type": "string" } + "schema": { "type": "string" }, + "example": "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZS1kZW1vIiwicm9sZSI6ImFub24ifQ.625_WdcF3KHqz5amU0x2X5WWHP-OEs_4qj0ssLNHzTs" } ], "responses": { @@ -971,7 +991,8 @@ "in": "header", "name": "authorization", "required": true, - "schema": { "type": "string" } + "schema": { "type": "string" }, + "example": "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZS1kZW1vIiwicm9sZSI6ImFub24ifQ.625_WdcF3KHqz5amU0x2X5WWHP-OEs_4qj0ssLNHzTs" } ], "responses": { @@ -1072,7 +1093,8 @@ "in": "header", "name": "authorization", "required": true, - "schema": { "type": "string" } + "schema": { "type": "string" }, + "example": "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZS1kZW1vIiwicm9sZSI6ImFub24ifQ.625_WdcF3KHqz5amU0x2X5WWHP-OEs_4qj0ssLNHzTs" } ], "responses": { diff --git a/spec/transforms/storage_v0_openapi_deparsed.json b/spec/transforms/storage_v0_openapi_deparsed.json index 80e308587e0..9b0e008c5f1 100644 --- a/spec/transforms/storage_v0_openapi_deparsed.json +++ b/spec/transforms/storage_v0_openapi_deparsed.json @@ -11,7 +11,8 @@ "type": "object", "properties": { "authorization": { - "type": "string" + "type": "string", + "example": "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZS1kZW1vIiwicm9sZSI6ImFub24ifQ.625_WdcF3KHqz5amU0x2X5WWHP-OEs_4qj0ssLNHzTs" } }, "required": [ @@ -82,7 +83,8 @@ "required": true, "schema": { "type": "string" - } + }, + "example": "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZS1kZW1vIiwicm9sZSI6ImFub24ifQ.625_WdcF3KHqz5amU0x2X5WWHP-OEs_4qj0ssLNHzTs" } ], "responses": { @@ -148,7 +150,8 @@ "required": true, "schema": { "type": "string" - } + }, + "example": "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZS1kZW1vIiwicm9sZSI6ImFub24ifQ.625_WdcF3KHqz5amU0x2X5WWHP-OEs_4qj0ssLNHzTs" } ], "responses": { @@ -271,7 +274,8 @@ "required": true, "schema": { "type": "string" - } + }, + "example": "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZS1kZW1vIiwicm9sZSI6ImFub24ifQ.625_WdcF3KHqz5amU0x2X5WWHP-OEs_4qj0ssLNHzTs" } ], "responses": { @@ -346,7 +350,8 @@ "required": true, "schema": { "type": "string" - } + }, + "example": "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZS1kZW1vIiwicm9sZSI6ImFub24ifQ.625_WdcF3KHqz5amU0x2X5WWHP-OEs_4qj0ssLNHzTs" } ], "responses": { @@ -457,7 +462,8 @@ "required": true, "schema": { "type": "string" - } + }, + "example": "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZS1kZW1vIiwicm9sZSI6ImFub24ifQ.625_WdcF3KHqz5amU0x2X5WWHP-OEs_4qj0ssLNHzTs" } ], "responses": { @@ -533,7 +539,8 @@ "required": true, "schema": { "type": "string" - } + }, + "example": "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZS1kZW1vIiwicm9sZSI6ImFub24ifQ.625_WdcF3KHqz5amU0x2X5WWHP-OEs_4qj0ssLNHzTs" } ], "responses": { @@ -618,7 +625,8 @@ "required": true, "schema": { "type": "string" - } + }, + "example": "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZS1kZW1vIiwicm9sZSI6ImFub24ifQ.625_WdcF3KHqz5amU0x2X5WWHP-OEs_4qj0ssLNHzTs" } ], "responses": { @@ -702,7 +710,8 @@ "required": true, "schema": { "type": "string" - } + }, + "example": "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZS1kZW1vIiwicm9sZSI6ImFub24ifQ.625_WdcF3KHqz5amU0x2X5WWHP-OEs_4qj0ssLNHzTs" } ], "responses": { @@ -767,7 +776,8 @@ "required": true, "schema": { "type": "string" - } + }, + "example": "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZS1kZW1vIiwicm9sZSI6ImFub24ifQ.625_WdcF3KHqz5amU0x2X5WWHP-OEs_4qj0ssLNHzTs" } ], "responses": { @@ -853,7 +863,8 @@ "required": true, "schema": { "type": "string" - } + }, + "example": "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZS1kZW1vIiwicm9sZSI6ImFub24ifQ.625_WdcF3KHqz5amU0x2X5WWHP-OEs_4qj0ssLNHzTs" } ], "responses": { @@ -957,7 +968,8 @@ "required": true, "schema": { "type": "string" - } + }, + "example": "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZS1kZW1vIiwicm9sZSI6ImFub24ifQ.625_WdcF3KHqz5amU0x2X5WWHP-OEs_4qj0ssLNHzTs" } ], "responses": { @@ -1153,7 +1165,8 @@ "required": true, "schema": { "type": "string" - } + }, + "example": "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZS1kZW1vIiwicm9sZSI6ImFub24ifQ.625_WdcF3KHqz5amU0x2X5WWHP-OEs_4qj0ssLNHzTs" } ], "responses": { @@ -1241,7 +1254,8 @@ "required": true, "schema": { "type": "string" - } + }, + "example": "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZS1kZW1vIiwicm9sZSI6ImFub24ifQ.625_WdcF3KHqz5amU0x2X5WWHP-OEs_4qj0ssLNHzTs" } ], "responses": { @@ -1419,7 +1433,8 @@ "required": true, "schema": { "type": "string" - } + }, + "example": "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZS1kZW1vIiwicm9sZSI6ImFub24ifQ.625_WdcF3KHqz5amU0x2X5WWHP-OEs_4qj0ssLNHzTs" } ], "responses": { @@ -1535,7 +1550,8 @@ "required": true, "schema": { "type": "string" - } + }, + "example": "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZS1kZW1vIiwicm9sZSI6ImFub24ifQ.625_WdcF3KHqz5amU0x2X5WWHP-OEs_4qj0ssLNHzTs" } ], "responses": { @@ -1667,7 +1683,8 @@ "required": true, "schema": { "type": "string" - } + }, + "example": "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZS1kZW1vIiwicm9sZSI6ImFub24ifQ.625_WdcF3KHqz5amU0x2X5WWHP-OEs_4qj0ssLNHzTs" } ], "responses": { @@ -1871,7 +1888,8 @@ "required": true, "schema": { "type": "string" - } + }, + "example": "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZS1kZW1vIiwicm9sZSI6ImFub24ifQ.625_WdcF3KHqz5amU0x2X5WWHP-OEs_4qj0ssLNHzTs" } ], "responses": {