diff --git a/packages/core/src/routes/logto-config.openapi.json b/packages/core/src/routes/logto-config.openapi.json index 64fd081b7523..479d100d4e33 100644 --- a/packages/core/src/routes/logto-config.openapi.json +++ b/packages/core/src/routes/logto-config.openapi.json @@ -188,6 +188,55 @@ } } } + }, + "/api/configs/jwt-customizer/test": { + "post": { + "summary": "Test JWT customizer", + "description": "Test the JWT customizer script with the given context and token payload.", + "requestBody": { + "content": { + "application/json": { + "schema": { + "properties": { + "tokenType": { + "description": "The token type to test the JWT customizer for." + }, + "payload": { + "properties": { + "contextSample": { + "description": "The sample context for the JWT customizer script testing purpose." + }, + "tokenSample": { + "description": "The sample token payload for the JWT customizer script testing purpose." + }, + "envVars": { + "description": "The environment variables for the JWT customizer." + }, + "script": { + "description": "The code snippet of the JWT customizer." + } + } + } + } + } + } + } + }, + "responses": { + "200": { + "description": "The result of the JWT customizer script." + }, + "400": { + "description": "Zod errors in cloud service (data type does not match expectation, can be either request body or response body)." + }, + "422": { + "description": "Cloud service syntax error." + }, + "500": { + "description": "Cloud service internal error." + } + } + } } } } diff --git a/packages/core/src/routes/logto-config.ts b/packages/core/src/routes/logto-config.ts index 9dc6592cc647..32a491690e78 100644 --- a/packages/core/src/routes/logto-config.ts +++ b/packages/core/src/routes/logto-config.ts @@ -309,11 +309,6 @@ export default function logtoConfigRoutes( }), ]), response: jsonObjectGuard, - /** - * Code 400 indicates Zod errors in cloud service (data type does not match expectation, can be either request body or response body). - * Code 422 indicates syntax errors in cloud service. - * Code 500 indicates internal server errors in cloud service. - */ status: [200, 400, 422, 500], }), async (ctx, next) => {