New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Custom method decorator #217
Comments
If you override |
@creaux Use middleware it's a solution for this issue but I solved this issue using Javascript Proxy export const PrintLog = (target, methodName, descriptor) => {
const className = target.constructor.name;
const original = descriptor.value;
descriptor.value = new Proxy(original, {
apply: function(target, thisArg, args) {
Logger.log(
`Call with args: ${JSON.stringify(args)}`,
`${className}#${methodName}`,
);
const result = target.apply(thisArg, args);
Logger.log(
`Return: ${JSON.stringify(result)}`,
`${className}#${methodName}`,
);
return result;
},
});
}; With Javascript Proxy I can override a |
Looks like quiet cool solution. |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Hi,
Im created a custom decorator for the controller method, this decorator print the function arguments and the result.
Issue: Swagger lose the query parameters
Minimal reproduction of the problem with instructions
The text was updated successfully, but these errors were encountered: