Skip to content

Clarify when consumes/produces take effect #581

@ePaul

Description

@ePaul

The 2.0 specification has the top-level consumes and produces properties, as well as for each operation.

When the operation is one whose HTTP method's definition doesn't include a payload semantic (most prominently GET, but also HEAD and DELETE, maybe OPTIONS), there is no point in saying the operation "consumes" anything (and there is no point in sending a Content-Type header when there is no body.)

On the operation level thus "consumes" should be forbidden for such operations, and the top-level "consumes" property should be declared in the description to not apply for such operations.

This was triggered by Issue swagger-api/swagger-codegen#2254.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions