Skip to content

application/x-www-form-urlencoded destructure missing consumes on generated @PostMapping #479

Description

@phlawski

Follow-up to #412, which introduced application/x-www-form-urlencoded destructure support in 2026.2.

When using body-style: destructure for a application/x-www-form-urlencoded requestBody, the generated @PostMapping does not include consumes = {"application/x-www-form-urlencoded"}. Spring therefore does not enforce the content-type restriction and silently accepts requests with any content-type (e.g. application/json) instead of returning 415.

multipart/form-data endpoints correctly generate consumes. application/json requestBodies correctly generate consumes. Only application/x-www-form-urlencoded is missing it.

Expected:

@PostMapping(path = "/token", consumes = {"application/x-www-form-urlencoded"}, produces = {"application/json"})

Actual:

 @PostMapping(path = "/token", produces = {"application/json"})

Version: openapi-processor-spring:2026.3.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions