| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
…n from_dict Optional list properties were being initialized with empty lists [] instead of UNSET when calling from_dict() with missing values. This caused unnecessary empty arrays to be included in API request payloads. The fix modifies the list_property.py.jinja template to: - Initialize optional list properties as UNSET with proper type annotations - Only create and populate lists when the source value is not UNSET - Preserve existing behavior for required list properties Fixes: openapi-generators#1305 Fixes: openapi-generators#961
There was a problem hiding this comment.
Looks great, thanks!
Sorry, something went wrong.
> [!IMPORTANT] > Merging this pull request will create this release ## Fixes - Remove non-existent CHANGELOG.md references from UV and Poetry templates (#1344) - Initialize optional lists as UNSET, not [] (#1346) - Correct docstring typos in client template (#1347) - Replace bare except blocks with specific exception types (#1348) ### Update `uv_build` to 0.9 #1352 by @johnthagen `uv` has been in the `0.9.x` release cycle for a while, so update templates to use the corresponding `uv_build` range. Co-authored-by: knope-bot[bot] <152252888+knope-bot[bot]@users.noreply.github.com>
| Back | FazBrowse Home | New Git URL |
Summary
Optional list properties were being incorrectly initialized with empty lists [] instead of UNSET when calling from_dict() with missing values. This breaks the semantic distinction between an omitted field and a field explicitly set to an empty list, which matters for PATCH operations and APIs that treat these cases differently.
Changes
The fix modifies the list_property.py.jinja template to:
Test Plan
Fixes #1305
Fixes #961