Skip to content

Commit

Permalink
feat: add logic to tag unstable routes
Browse files Browse the repository at this point in the history
  • Loading branch information
andrew-scott-fischer committed Apr 1, 2024
1 parent 992b1c8 commit bd8c143
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/openapi-generator/src/openapi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ function routeToOpenAPI(route: Route): [string, string, OpenAPIV3.OperationObjec
const operationId = jsdoc.tags?.operationId;
const tag = jsdoc.tags?.tag ?? '';
const isInternal = jsdoc.tags?.private !== undefined;
const isUnstable = jsdoc.tags?.unstable !== undefined;

const requestBody =
route.body === undefined
Expand All @@ -137,6 +138,7 @@ function routeToOpenAPI(route: Route): [string, string, OpenAPIV3.OperationObjec
...(operationId !== undefined ? { operationId } : {}),
...(tag !== '' ? { tags: [tag] } : {}),
...(isInternal ? { 'x-internal': true } : {}),
...(isUnstable ? { 'x-unstable': true } : {}),
parameters: route.parameters.map((p) => {
// Array types not allowed here
const schema = schemaToOpenAPI(p.schema);
Expand Down

0 comments on commit bd8c143

Please sign in to comment.