Skip to content

Is there a way to exclude an endpoint from the docs generator? #772

Answered by kole
kole asked this question in Q&A
Discussion options

You must be logged in to vote

I solved this problem like this:

// routes.ts
export const documentedRoutes: Routes = {}
export const undocumentedRoutes: Routes = {}
export const routes: Routes = { ...documentedRoutes, ...undocumentedRoutes }
// docs-generator.ts
import { documentedRoutes } from ./routes.ts

const yamlStr = new OpenAPI({
  routing: documentedRoutes,
  ...etc
}).getSpecAsYaml()

But it would be cool / nice if you could just tag a route "ignore-documentation" or something.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by RobinTail
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant