-
Notifications
You must be signed in to change notification settings - Fork 982
Open
Description
Additional media types (+json)
What?
Support RFC6839 allowing formatters for additional media types structured with syntax suffixes, like +json
.
Valid examples are: application/calendar+json
, application/problem+json
, application/geo+json
, etc (the full list can be seen on mime-db)...
Why?
Right now if you try to follow RFC7807 and send back a Content-Type application/problem+json
, it won't find the correct formatter (which is json
) and will override the content-type to application/octet-stream
.
Example API
server.get('/', function (req, res, next) {
res.contentType = 'problem+json';
res.send({
"type": "https://example.com/probs/out-of-credit",
"title": "You do not have enough credit.",
"detail": "Your current balance is 30, but that costs 50."
});
});
Are you willing and able to implement this?
I'm converting PR #1786 from RFC7807
to RFC6839
and we can tackle RFC7807
on a separate issue.
Metadata
Metadata
Assignees
Labels
No labels