-
Notifications
You must be signed in to change notification settings - Fork 198
[WIP] Use Accept header for Content-Type of response #27
[WIP] Use Accept header for Content-Type of response #27
Conversation
In other words: what is the reason to have hard-coded MIME types in the code rather than relying on |
@BigstickCarpet: Do you already have any opinion on that? I think that this is a prerequisite for #23. So I'd rather not continue work on that. |
Yeah, you're right. The |
Thank you for the feedback! I'll try to come up with some intelligent logic then... 😄 |
Currently, I don't agree that the |
d9611ec
to
9ec0385
Compare
9b90333
to
745aa7d
Compare
745aa7d
to
103e9c2
Compare
.omit(function (header, name) { | ||
return !_.isObject(header) || | ||
!_.includes(['string', 'number', 'integer', 'boolean', 'array'], header.type) || | ||
!_.isString(name) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing semicolon
Fixed. However I don't agree with this rule. 😉 See for example https://github.com/feross/standard
6e6f371
to
25f34a5
Compare
dd8b90b
to
6f6b591
Compare
I won't finish this as we have decided not to use swagger. |
Current behavior is that server decides what MIME types are acceptable and which of those are preferred. Shouldn't this really be the business of the client and the
Accept
-header?If Swagger definition and
Accept
-header of client agree onimage/jpeg
, but an object should be sent,application/json
is used anyway. In such a situation, I would rather prefer406 Not Acceptable
.This influences how I would proceed on #23.