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
New Feature: Add support for parsing JSON-like Content-types #15
Comments
I think we can easily add this as the option to accept a string in the options object and just provide that string to |
I'm not 100% sure how Imo, the easiest and best way to fix this is just like |
That is how type-is works, but it's perfectly fine. If you want to parse both app.use(bodyParser.json())
app.use(bodyParser.json({type: 'application/vnd.api+json'})) Using a parser for each type also would let the user do stuff like giving a different |
+1 didn't really know you could do that. |
@dougwilson: Neat! I like the new way :) Thanks! When this feature will be get published in the npm registry? |
As soon as I can, so probably today some time. I like to let the potential release sit a bit before hitting "publish" so I can think on it and prevent some dumb mistake :) |
Also gives time for people (read: me) to land doc nits before the next release hah. :P |
@Fishrock123 I saw that commit, haha. |
@diosney published as 1.1.0 |
@dougwilson Thanks! I already tested it and worked like a charm. :) Thanks again for your hard work :) |
For instance, the ability to parse Content-types === 'xxx+json', like
application/vnd.api+json
, fi.Currently
bodyParser.json()
only parses Content-types === 'application/json', which is very limited.Thanks
Related: #13
The text was updated successfully, but these errors were encountered: