You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
application/x-www-form-urlencoded destructure generates @NotNull on optional form parameters #478
Follow-up to #412, which introduced application/x-www-form-urlencoded destructure support in 2026.2.
When using body-style: destructure (the default) for a application/x-www-form-urlencoded requestBody, the processor adds @NotNull to all generated @RequestParam parameters regardless of whether the field is listed in the schema's required array.
Expected: Only parameters listed in required should get @NotNull. Optional fields should get @RequestParam(name = "foo" required = false) with no @NotNull.
Actual: All destructured form parameters get @NotNull, making it impossible to call the endpoint without providing all fields - breaking flows like OAuth2 refresh_token where code, code_verifier, redirect_uri are legitimately absent.
Reproduction:
requestBody:
content:
application/x-www-form-urlencoded:
schema:
type: object
required:
- grant_type
properties:
grant_type:
type: string
code:
type: string # optional — NOT in required
code_verifier:
type: string # optional — NOT in required
Activity
hauner commentedon Jun 29, 2026
I can reproduce this, looking at it.
fix required flag when destructuring an urlencoded object to paramete…
fix required flag when destructuring an urlencoded object to paramete…
hauner commentedon Jul 1, 2026
thanks for reporting :-)
fix required flag when destructuring an urlencoded object to paramete…
fix the expected test output (#478)
fix the expected test output (#478)
hauner commentedon Jul 7, 2026
fixed in openapi-processor-spring 2026.3.2