-
Notifications
You must be signed in to change notification settings - Fork 58
Description
Issue
The consumes
property on a generated method should not be populated by reading the @Accept
decorator. Accept
header is the media type allowed by the client in responses, and the @Accept
decorator is used by the service to determine the media type of responses.
Proposal
I propose consumes
be changed to read the value of a new @Consumes
decorator to match the current @Produces
. Additionally, we could be smart about this and read the type
property of @BodyOptions
options if specified. If that value is a string, use it as the value of consumes
. In case both decorators are specified, @Consumes
should take precedence as an explicitly declared value. Similarly, we should read the value of @Accept
to determine the produces
property if @Produces
is not specified.
(I'd be happy to code this up. Just seeking input here.)