@nestjs/swagger
Version:
OpenAPI for NestJS: generate the API document from controllers and decorators, serve Swagger UI, and derive request types with mapped types.
10 lines (9 loc) • 354 B
JavaScript
import { DECORATORS } from '../constants.js';
export function ApiDefaultGetter(type, parameter) {
return (prototype, key, descriptor) => {
if (type.prototype) {
Reflect.defineMetadata(DECORATORS.API_DEFAULT_GETTER, { getter: descriptor.value, parameter, prototype }, type.prototype);
}
return descriptor;
};
}