UNPKG

@nestjs/swagger

Version:

OpenAPI for NestJS: generate the API document from controllers and decorators, serve Swagger UI, and derive request types with mapped types.

9 lines (8 loc) • 366 B
import { DECORATORS } from '../constants.js'; import { getClassParameters } from '../utils/get-class-parameters.util.js'; export const exploreGlobalApiHeaderMetadata = (metatype) => { const headers = getClassParameters(DECORATORS.API_HEADERS, metatype); return headers.length > 0 ? { root: { parameters: headers }, depth: 1 } : undefined; };