Skip to content

Conversation

@dbanty
Copy link
Collaborator

@dbanty dbanty commented Nov 6, 2025

Fixes #1354

_json: dict[str, Any] | Unset = UNSET
if not isinstance(body, Unset):
_json = body.to_dict()
_kwargs["json"] = _json
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gotta move this under the if check

@dbanty dbanty force-pushed the fix-optional-bodies branch from c39737d to 0b1c3c2 Compare November 7, 2025 16:39
Comment on lines 19 to 23
| Unset
| PostBodiesMultipleDataBody
| Unset
| PostBodiesMultipleFilesBody
| Unset = UNSET,
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unions still aren't quite right. This shouldn't list Unset twice and in a different, local union test it was trying to call .to_dict() on an Unset

@expobrain expobrain closed this Nov 25, 2025
@dbanty dbanty deleted the fix-optional-bodies branch November 25, 2025 16:24
@dbanty dbanty mentioned this pull request Nov 25, 2025
dbanty added a commit that referenced this pull request Dec 3, 2025
Reopening #1357

Co-authored-by: Dylan Anthony <dbanty@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Json requestBody cannot be optional

4 participants