-
Notifications
You must be signed in to change notification settings - Fork 14
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
Non JSON body parser #191
Comments
I think this lib is not meant to provide a parser for JSON based body. You need to add your own json body parser:
You can add any body parser in the system (json, form-data, custom):
|
Correct. |
BYO body-parser is understandable, and it's what a lot of libs actually do. But from ergonomics perspective, wouldn't custom-body-parser help in providing request-body types for typera-openapi? eg). route
.useBodyParser(Parser.json) // --> "application/json"
.useBodyParser(Parser.formDataNoFiles) // --> "application/x-www-form-urlencoded"
.useBodyParser(Parser.formDataWithFiles) // --> "multipart/form-data" Or is it possible to create a 'body-parser wrapper'?:
(* sorry the examples are horrible) |
This is actually a very good idea! I opened a new issue: #306 |
Hello! Thank you for the good work. It makes coding with express almost pleasant :D (its middleware system is still crazily untyped but it's now manageable)
Am I correct to assume the scope of this lib so far is to provide a parser only for JSON based bodies? Do you have any plan to add parsing for multipart, binary, etc? If nope, perhaps you can add some pointers in the documentation as to how to quickly plug an express middleware to parse a file, etc? Perhaps that could be a real life example of how to use https://github.com/akheron/typera#using-express-middleware ?
Cheers
The text was updated successfully, but these errors were encountered: