fix: extend zip rename overlay to component schemas#40
Merged
Conversation
The existing $.paths..schema..zip rule only matches `zip` properties in inline schemas under paths. Many address schemas live under components.schemas and are referenced via $ref from path operations — those zip occurrences never get renamed, so the generated Python ends up with parameters named `zip`, which shadows the `zip()` builtin and fails pylint W0622 during the Compile SDK step (most recent failure: gusto/gusto-python-client run 26044020966, contractors.py :2181 and locations.py:251). Add a second rule targeting $.components.schemas..properties.zip so the rename covers every `zip` postal-code property the spec exposes, regardless of whether it's inlined or $ref'd. Applied to both the embedded and app_int overlays.
rqsilva
approved these changes
May 19, 2026
rqsilva
left a comment
There was a problem hiding this comment.
AFAIK no one is consuming the python client, so this change should be fine, right?
Collaborator
Author
|
@rqsilva yes, also because of this issue, we've never actually generated a client that contains this |
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
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The existing zip→zip_code rename overlay only matches
zipproperties that appear in inline schemas underpaths. Many address schemas (e.g.,Location,Contractor-Address) live undercomponents.schemasand are referenced via\$reffrom path operations — those zip occurrences never get renamed.Newly generated method signatures that go through
\$ref'd component schemas end up with bare `zip` parameters, which shadow Python's `zip()` builtin. Pylint W0622 then fails the Compile SDK step:```
src/gusto_embedded/locations.py:251:8: W0622: Redefining built-in 'zip' (redefined-builtin)
src/gusto_embedded/locations.py:402:8: W0622: Redefining built-in 'zip' (redefined-builtin)
src/gusto_embedded/contractors.py:2181:8: W0622: Redefining built-in 'zip' (redefined-builtin)
src/gusto_embedded/contractors.py:2323:8: W0622: Redefining built-in 'zip' (redefined-builtin)
```
(Most recent failure: run #26044020966.)
Change
Adds a second overlay rule targeting `$.components.schemas..properties.zip` so the rename covers every `zip` postal-code property the spec exposes, regardless of whether it's inlined or $ref'd. Applied to both the `gusto_embedded` and `gusto_app_int` overlays since they share the same gap.
Test plan
🤖 Generated with Claude Code