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 non-file fields in Multipart requests #351
the generated code will call httpx.post(files=dict(file=file, options=options)) which causes a server-side pydantic validation error (options should be of type str).
Describe the solution you'd like
The correct invocation would be httpx.post(data=dict(options=options), files=dict(file=file)) (see relevant page from httpx docs)
Describe alternatives you've considered
Some sort of server-side workaround, but it might be somewhat ugly.
Activity
csymeonides-mf commentedon Mar 20, 2021
For reference, my server-side workaround was to add a custom pydantic validator for that field:
fix: Allow passing data with files in multipart. (Fixes #351)