@nestjs/swagger
Version:
OpenAPI for NestJS: generate the API document from controllers and decorators, serve Swagger UI, and derive request types with mapped types.
13 lines (12 loc) • 367 B
JavaScript
import { DECORATORS } from '../constants.js';
export function getClassExtensions(metatype) {
if (!metatype || metatype === Function.prototype) {
return {};
}
const own = Reflect.getOwnMetadata(DECORATORS.API_EXTENSION, metatype);
return {
...own,
...getClassExtensions(Object.getPrototypeOf(metatype)),
...own
};
}