Bug: Cannot use `dateIn` as an input for a middleware
See original GitHub issueAnother small bug my team discovered:
Right now, it’s not possible to define a middleware with a dateIn
input. Calling an endpoint using such a middleware always results in a <field_name>: Expected string, received date
error.
I didn’t have time to look into the source code here, but it seems like inputs might be parsed/validated multiple times (once at the middleware and then again at the endpoint), and by the time they’re checked for the second time the date string has already been parsed to a date (which is not the expected input type of dateIn
). Could that be the case?
Issue Analytics
- State:
- Created a year ago
- Reactions:1
- Comments:10 (10 by maintainers)
Top Results From Across the Web
Presence of middleware prevents access to raw request ...
Describe the Bug. When attempting to upload a file over a few kilobytes (e.g. sending a POST request with a binary body and...
Read more >Full Stack Error Handling with GraphQL and Apollo
Errors can range from bad user inputs to back-end bugs to rare network outages. Since it's at the center of all the action,...
Read more >Cannot app.use(multer). "requires middleware function" error
I'm just starting learning NodeJS and I am stuck with a problem. I would like to upload files to ...
Read more >Known Issues for Oracle SOA Products 12.1.3
Workaround: Log in to Oracle Enterprise Manager Fusion Middleware Control using the exact case sensitivity with which you created the user in Oracle...
Read more >How to validate if input date (end date) in input field must be ...
Use the validation name(validateInputField) in the routes as a middleware as an array of validations. Destructure 'validationResult' function ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Awesome, thank you so much! 🙌
Ok, thank you for the code sample. I will check it soon, @shroudedcode