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
Support parameter expansion for application/x-www-form-urlencoded similar to multipart/form-data #412
While using openapi-processor-spring, I noticed an inconsistency in how multipart/form-data and application/x-www-form-urlencoded request bodies
are handled.
Instead of generating a @RequestBody parameter for the object schema the
processor creates a parameter for each property of the object annotated
with @RequestParam
This behavior works very well for multipart/form-data.
However, for application/x-www-form-urlencoded, the processor always generates
a single @RequestBody parameter, even when the request body schema is an
object with simple scalar properties.
In Spring MVC, both multipart/form-data and application/x-www-form-urlencoded are typically handled as request parameters
(@RequestParam / form fields), not as a raw request body.
This causes issues for common and important use cases such as OAuth2 token
endpoints (/token), where application/x-www-form-urlencoded is required
by the specification.
Expected behavior
For application/x-www-form-urlencoded request bodies with an object schema,
the processor should generate one @RequestParam per property, similar to the
existing behavior for multipart/form-data.
I think it would be nice too if it could drop the @RequestBody, assuming that Spring will nicely fill the parameter object. This would probably need a switch to decide which variant it should generate. I have to test that.
Activity
hauner commentedon Jan 15, 2026
Yes, it should do that.
I think it would be nice too if it could drop the
@RequestBody, assuming that Spring will nicely fill the parameter object. This would probably need a switch to decide which variant it should generate. I have to test that.Thanks for reporting :-)
convert urlencoded request body to query parameters (openapi-processo…
clean up error handling (openapi-processor/openapi-processor-spring#412)
keep the data type, but reduce usage count (openapi-processor/openapi…
configure body-style (openapi-processor/openapi-processor-spring#412)
handle body-style (openapi-processor/openapi-processor-spring#412)
add body-style (openapi-processor/openapi-processor-spring#412)
add integration test (#412)
add documentation (#412)
add integration test (openapi-processor/openapi-processor-spring#412)
fix test name (openapi-processor/openapi-processor-spring#412)
improve documentation (#412)
improve urlencoded body handling (#412)
improve body handling (openapi-processor/openapi-processor-spring#412)
fix test (openapi-processor/openapi-processor-spring#412)