FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

fix: do not emit Unset for required multi-body endpoints (#1451) by Rajan-vish · Pull Request #1517 · openapi-generators/openapi-python-client · GitHub

Repository navigation

fix: do not emit Unset for required multi-body endpoints (#1451) - #1517

Open
Rajan-vish wants to merge 1 commit into
openapi-generators:mainfrom
Rajan-vish:fix-multi-body-required-unset-1451
Open

Rajan-vish wants to merge 1 commit into
openapi-generators:mainfrom
Rajan-vish:fix-multi-body-required-unset-1451

Conversation

Copy link
Copy Markdown

Fixes #1451

When an endpoint has multiple bodies and the request body is required, the arguments macro in endpoint_macros.py.jinja was still appending | Unset = UNSET. This happened because body_required was not preserved across Jinja loop iterations with a namespace, leaving it undefined outside the loop.

This uses a Jinja namespace to track whether all bodies are required, and adds unit and functional tests covering the change.

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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.

Multi-body endpoints with required requestBody emit | Unset without importing Unset

1 participant


Back | FazBrowse Home | New Git URL