diff --git a/src/lib/openapi/endpoint-descriptions.ts b/src/lib/openapi/endpoint-descriptions.ts index 8e2dcfb1fd..75c9f689db 100644 --- a/src/lib/openapi/endpoint-descriptions.ts +++ b/src/lib/openapi/endpoint-descriptions.ts @@ -2,7 +2,7 @@ export const endpointDescriptions = { admin: { events: { description: - 'Returns **the last 100** from the Unleash instance when called without a query parameter. When called with a `project` parameter, returns **all events** for the specified project.\n\nIf the provided project does not exist, the list of events will be empty.', + 'Returns **the last 100** events from the Unleash instance when called without a query parameter. When called with a `project` parameter, returns **all events** for the specified project.\n\nIf the provided project does not exist, the list of events will be empty.', summary: 'Get the most recent events from the Unleash instance or all events related to a project.', }, diff --git a/src/lib/routes/public-invite.ts b/src/lib/routes/public-invite.ts index ac5f6588bc..0cc91f3c4d 100644 --- a/src/lib/routes/public-invite.ts +++ b/src/lib/routes/public-invite.ts @@ -70,8 +70,9 @@ export class PublicInviteController extends Controller { openApiService.validPath({ tags: ['Public signup tokens'], operationId: 'addPublicSignupTokenUser', - summary: - 'Create a user with the "viewer" root role and link them to a signup token', + summary: 'Add a user via a signup token', + description: + 'Create a user with the viewer root role and link them to the provided signup token', requestBody: createRequestSchema('createInvitedUserSchema'), responses: { 200: createResponseSchema('userSchema'), diff --git a/src/test/e2e/api/openapi/__snapshots__/openapi.e2e.test.ts.snap b/src/test/e2e/api/openapi/__snapshots__/openapi.e2e.test.ts.snap index 097e791975..0e51e16351 100644 --- a/src/test/e2e/api/openapi/__snapshots__/openapi.e2e.test.ts.snap +++ b/src/test/e2e/api/openapi/__snapshots__/openapi.e2e.test.ts.snap @@ -4304,7 +4304,7 @@ exports[`should serve the OpenAPI spec 1`] = ` }, "/api/admin/events": { "get": { - "description": "Returns **the last 100** from the Unleash instance when called without a query parameter. When called with a \`project\` parameter, returns **all events** for the specified project. + "description": "Returns **the last 100** events from the Unleash instance when called without a query parameter. When called with a \`project\` parameter, returns **all events** for the specified project. If the provided project does not exist, the list of events will be empty.", "operationId": "getEvents", @@ -7364,6 +7364,7 @@ If the provided project does not exist, the list of events will be empty.", }, "/invite/{token}/signup": { "post": { + "description": "Create a user with the viewer root role and link them to the provided signup token", "operationId": "addPublicSignupTokenUser", "parameters": [ { @@ -7404,7 +7405,7 @@ If the provided project does not exist, the list of events will be empty.", "description": "The provided resource can not be created or updated because it would conflict with the current state of the resource or with an already existing resource, respectively.", }, }, - "summary": "Create a user with the "viewer" root role and link them to a signup token", + "summary": "Add a user via a signup token", "tags": [ "Public signup tokens", ], diff --git a/website/clean-generated-docs.js b/website/clean-generated-docs.js index 116a15ae60..484e5bc072 100644 --- a/website/clean-generated-docs.js +++ b/website/clean-generated-docs.js @@ -17,14 +17,27 @@ // save us loooots of questions. const replace = require('replace-in-file'); +const escapeCharacters = (input) => { + unquotedInput = + input.charAt(0) === '"' ? input.substring(1, input.length - 1) : input; + const fixed = unquotedInput.replace(/(?"', + '"path":[', + (_, key, description) => `${key}: ${escapeCharacters(description)}`, ], - to: ['', '""', '"path":['], }; replace(options);