Skip to content

Commit

Permalink
chore: only use operation objects
Browse files Browse the repository at this point in the history
  • Loading branch information
smeijer committed Jul 11, 2023
1 parent bb5e66d commit 79d9052
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions docs/lib/openapi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,14 @@ export function getApiLinks(spec: OpenAPIV3.Document) {
return Object.keys(spec.paths).flatMap((pathName) => {
const path = spec.paths[pathName as keyof typeof spec.paths] || {};

return Object.keys(path).map((method) => {
const { operationId, summary } = path[
method as keyof typeof path
] as OpenAPIV3.OperationObject;

return { path: pathName, method, operationId, summary };
});
return Object.keys(path)
.map((method) => {
const { operationId, summary } = path[
method as keyof typeof path
] as OpenAPIV3.OperationObject;

return { path: pathName, method, operationId, summary };
})
.filter((x) => x.operationId);
});
}

0 comments on commit 79d9052

Please sign in to comment.