Skip to content

Commit 3813825

Browse files
committed
fix: extend zip rename overlay to component schemas
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.
1 parent 98ef86e commit 3813825

2 files changed

Lines changed: 20 additions & 0 deletions

File tree

gusto_app_int/.speakeasy/speakeasy-modifications-overlay.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,16 @@ info:
88
before: ""
99
type: speakeasy-modifications
1010
actions:
11+
# Rename the `zip` postal-code property to `zip_code` so the generated
12+
# Python SDK doesn't shadow the `zip()` builtin (pylint W0622 fails the
13+
# Compile SDK step). The original rule only matched inline schemas under
14+
# `paths`; many address schemas live under `components.schemas` and are
15+
# referenced via $ref, so we also need to rewrite the property there.
16+
# Both rules together cover every `zip` postal-code property the spec
17+
# exposes.
1118
- target: $.paths..schema..zip
1219
update:
1320
x-speakeasy-name-override: zip_code
21+
- target: $.components.schemas..properties.zip
22+
update:
23+
x-speakeasy-name-override: zip_code

gusto_embedded/.speakeasy/speakeasy-modifications-overlay.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,16 @@ info:
88
before: ""
99
type: speakeasy-modifications
1010
actions:
11+
# Rename the `zip` postal-code property to `zip_code` so the generated
12+
# Python SDK doesn't shadow the `zip()` builtin (pylint W0622 fails the
13+
# Compile SDK step). The original rule only matched inline schemas under
14+
# `paths`; many address schemas live under `components.schemas` and are
15+
# referenced via $ref, so we also need to rewrite the property there.
16+
# Both rules together cover every `zip` postal-code property the spec
17+
# exposes.
1118
- target: $.paths..schema..zip
1219
update:
1320
x-speakeasy-name-override: zip_code
21+
- target: $.components.schemas..properties.zip
22+
update:
23+
x-speakeasy-name-override: zip_code

0 commit comments

Comments
 (0)