Skip to content

Consumes value should not read @Accept #29

@ngraef

Description

@ngraef

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.)

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions