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 }}
This repository was archived by the owner on Apr 14, 2026. It is now read-only.
Operations with application/x-www-form-urlencoded request bodies
produced uncompilable code: the SimpleClient referenced undefined
typed body structs and methods because the code generator only
recognized application/json content types.
This change introduces a config-driven ContentTypeMatcher that
determines which content types get typed request body methods,
replacing the hard-coded IsJSON checks. form-urlencoded is now
included in the default content-type list alongside JSON.
For form-encoded bodies, serialization uses a new marshalForm
helper (reflection-based, using json struct tags) instead of
json.Marshal, avoiding a JSON round-trip that would produce
incorrect form encoding.
Key changes:
- Replace RequestBodyDescriptor.IsJSON with GenerateTyped (config-driven)
and IsFormEncoded (content-type flag)
- Add ContentTypeMatcher to operationGatherer and all Gather*Operations
call sites
- Add DefaultTypedBody/HasTypedBody to OperationDescriptor so the
SimpleClient template picks the correct typed body
- Add marshalForm/marshalFormImpl helper template for struct-to-url.Values
serialization
- Update client, initiator, and simple-client templates to branch on
IsFormEncoded vs JSON for body serialization
Closes#2
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
0 commit comments