Skip to content
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

Name middleware #583

Merged
merged 5 commits into from Apr 23, 2021
Merged

Name middleware #583

merged 5 commits into from Apr 23, 2021

Conversation

benblack86
Copy link
Contributor

For tracing, anonymous functions wouldn't show up with name. I've converted these anonymous functions to named functions so it is a little more clearer what is happening. Let me know if you think a different naming schema would be better.

Screen Shot 2021-04-14 at 16 01 18

src/openapi.validator.ts Outdated Show resolved Hide resolved
src/openapi.validator.ts Outdated Show resolved Hide resolved
@cdimascio
Copy link
Owner

@benblack86 thanks!

@benblack86
Copy link
Contributor Author

Updated

let inited = false;
// install path params
middlewares.push((req, res, next) =>
pContext
middlewares.push(function PathParamsMiddleware(req, res, next) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

one more nit. use lower case camelCase for the function names e.g. pathParamsMiddleware. apologies for not being clear with my first comment

@benblack86
Copy link
Contributor Author

Updated

Copy link
Owner

@cdimascio cdimascio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks!

@cdimascio cdimascio merged commit c921737 into cdimascio:master Apr 23, 2021
crudo pushed a commit to crudo/express-openapi-validator that referenced this pull request Aug 17, 2021
* Name middleware

* Fix this

* Add comment

* Updates

* Lowercase
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants