@fastify/swagger
Version:
Serve Swagger/OpenAPI documentation for Fastify, supporting dynamic generation
26 lines (18 loc) • 381 B
JavaScript
function shouldRouteHide (schema, opts) {
const { hiddenTag, hideUntagged } = opts
if (schema?.hide) {
return true
}
const tags = schema?.tags || []
if (tags.length === 0 && hideUntagged) {
return true
}
if (tags.includes(hiddenTag)) {
return schema.tags.includes(hiddenTag)
}
return false
}
module.exports = {
shouldRouteHide
}