fix: sync SDK with Etsy API spec — correctness fixes and completeness#13
fix: sync SDK with Etsy API spec — correctness fixes and completeness#13amitray007 merged 5 commits intomasterfrom
Conversation
… improvements - Fix UpdateListingRequest.nullable using "type" instead of "_type" (silent serialization bug) - Remove State.REMOVED enum value not present in OAS spec - Add missing `legacy` query param to get_listings_by_listing_ids - Add missing `legacy` query param to get_shop_receipt_transactions_by_shop - Add Includes.PERSONALIZATION enum value from OAS spec - Add deprecation warnings for personalization_is_required, personalization_char_count_max, and personalization_instructions fields (Etsy removing April 9, 2026) - Update baseline spec Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…s, _type nullable) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Test Coverage ReportOverall: 93% (1531/1641 statements covered) Coverage by file
Updated by PR Tests |
There was a problem hiding this comment.
Pull request overview
This PR syncs the Python SDK with the latest Etsy API spec by fixing request model correctness issues, aligning enums with the OAS, and adding missing optional query parameters and deprecation warnings.
Changes:
- Fix nullable handling for
UpdateListingRequestby using_type(matching model attribute keys). - Add missing
legacyquery param support to batch listings and shop receipt transactions endpoints. - Update listing enums (remove invalid
State.REMOVED, addIncludes.PERSONALIZATION) and add deprecation warnings/tests for soon-to-be-removed personalization fields.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
etsy_python/v3/models/Listing.py |
Adds deprecation warnings for deprecated personalization fields; fixes UpdateListingRequest.nullable to use _type. |
etsy_python/v3/resources/Listing.py |
Adds legacy query param forwarding to get_listings_by_listing_ids. |
etsy_python/v3/resources/ReceiptTransactions.py |
Adds legacy query param forwarding to get_shop_receipt_transactions_by_shop. |
etsy_python/v3/enums/Listing.py |
Removes invalid State.REMOVED; adds Includes.PERSONALIZATION. |
tests/test_listing_models.py |
Adds tests for _type nullable behavior and personalization deprecation warnings. |
tests/test_listing_resource.py |
Adds tests ensuring listing_ids are joined and legacy is passed/defaulted. |
tests/test_remaining_resources.py |
Adds tests for legacy handling in shop receipt transactions-by-shop. |
specs/baseline.json |
Updates baseline OAS content to the latest spec. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
Both Copilot review comments addressed in 09d1b8c — the deprecated aliases |
…rwarding tests - Restore State.REMOVED with comment noting it's not in OAS spec (avoids breaking users who reference it) - Add tests verifying deprecated wrappers forward the legacy parameter Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Closes #12
Summary
UpdateListingRequest.nullablebug: Changed"type"to"_type"— the nullable field matching was silently broken becauseget_nulled()compares against__dict__keys (which use_type), not API keysState.REMOVED: Not present in the OAS spec; was an invalid enum value exposed to userslegacyparam toget_listings_by_listing_idsandget_shop_receipt_transactions_by_shop— both were missing this optional boolean query parameter present in the specIncludes.PERSONALIZATION: Missing enum value for theincludesquery parameter across listing endpointspersonalization_is_required,personalization_char_count_max, andpersonalization_instructionsfields inCreateDraftListingRequestandUpdateListingRequest— Etsy removes these April 9, 2026_typenullable fix, and deprecation warning behaviorAudit results: 100% endpoint coverage (103/103 operations mapped). No new or removed endpoints in the spec.
Test plan
pytest -v)_typenullable fix with existingtest_type_nullable_uses_underscore_prefixtestlegacyparam forwarded correctly with new tests🤖 Generated with Claude Code