Skip to content

fix: sync SDK with Etsy API spec — correctness fixes and completeness#13

Merged
amitray007 merged 5 commits intomasterfrom
release/sdk-audit-2026-03-16
Mar 16, 2026
Merged

fix: sync SDK with Etsy API spec — correctness fixes and completeness#13
amitray007 merged 5 commits intomasterfrom
release/sdk-audit-2026-03-16

Conversation

@amitray007
Copy link
Copy Markdown
Owner

@amitray007 amitray007 commented Mar 16, 2026

Closes #12

Summary

  • Fix UpdateListingRequest.nullable bug: Changed "type" to "_type" — the nullable field matching was silently broken because get_nulled() compares against __dict__ keys (which use _type), not API keys
  • Remove State.REMOVED: Not present in the OAS spec; was an invalid enum value exposed to users
  • Add missing legacy param to get_listings_by_listing_ids and get_shop_receipt_transactions_by_shop — both were missing this optional boolean query parameter present in the spec
  • Add Includes.PERSONALIZATION: Missing enum value for the includes query parameter across listing endpoints
  • Add deprecation warnings for personalization_is_required, personalization_char_count_max, and personalization_instructions fields in CreateDraftListingRequest and UpdateListingRequest — Etsy removes these April 9, 2026
  • Update baseline spec to latest
  • 10 new tests covering legacy params, _type nullable fix, and deprecation warning behavior

Audit results: 100% endpoint coverage (103/103 operations mapped). No new or removed endpoints in the spec.

Test plan

  • All 229 tests pass (pytest -v)
  • Verified _type nullable fix with existing test_type_nullable_uses_underscore_prefix test
  • Verified legacy param forwarded correctly with new tests
  • Verified deprecation warnings fire only when personalization fields are set
  • Verified no warnings when personalization fields are omitted
  • Code review passed with no critical issues

🤖 Generated with Claude Code

amitray007 and others added 2 commits March 16, 2026 16:10
… 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>
@amitray007 amitray007 self-assigned this Mar 16, 2026
Copilot AI review requested due to automatic review settings March 16, 2026 10:46
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Mar 16, 2026

Test Coverage Report

Overall: 93% (1531/1641 statements covered)

Coverage by file
File Statements Missing Coverage
etsy_python/v3/auth/OAuth.py 33 33 0%
etsy_python/v3/auth/__init__.py 1 1 0%
etsy_python/v3/enums/Language.py 12 12 0%
etsy_python/v3/enums/ListingInventory.py 3 3 0%
etsy_python/v3/models/ProcessingProfile.py 21 10 52%
etsy_python/v3/models/ShopReturnPolicy.py 25 11 56%
etsy_python/v3/resources/ProcessingProfile.py 26 11 58%
etsy_python/v3/models/HolidayPreferences.py 8 2 75%
etsy_python/v3/models/Miscellaneous.py 8 2 75%
etsy_python/v3/common/Utils.py 31 4 87%
etsy_python/v3/exceptions/RequestException.py 8 1 88%
etsy_python/v3/resources/Response.py 9 1 89%
etsy_python/v3/exceptions/BaseAPIException.py 10 1 90%
etsy_python/v3/models/Request.py 22 2 91%
etsy_python/v3/resources/Listing.py 81 6 93%
etsy_python/v3/models/Listing.py 148 9 94%
etsy_python/v3/resources/Session.py 94 1 99%
etsy_python/__init__.py 2 0 100%
etsy_python/_version.py 1 0 100%
etsy_python/v3/common/Env.py 10 0 100%
etsy_python/v3/common/Request.py 3 0 100%
etsy_python/v3/enums/HolidayPreferences.py 29 0 100%
etsy_python/v3/enums/Listing.py 77 0 100%
etsy_python/v3/enums/ProcessingProfile.py 7 0 100%
etsy_python/v3/enums/ShippingProfile.py 261 0 100%
etsy_python/v3/enums/ShopReceipt.py 12 0 100%
etsy_python/v3/exceptions/__init__.py 2 0 100%
etsy_python/v3/models/FileRequest.py 7 0 100%
etsy_python/v3/models/Product.py 7 0 100%
etsy_python/v3/models/Receipt.py 18 0 100%
etsy_python/v3/models/ShippingProfile.py 85 0 100%
etsy_python/v3/models/Shop.py 24 0 100%
etsy_python/v3/models/Utils.py 19 0 100%
etsy_python/v3/models/__init__.py 10 0 100%
etsy_python/v3/resources/HolidayPreferences.py 17 0 100%
etsy_python/v3/resources/ListingFile.py 22 0 100%
etsy_python/v3/resources/ListingImage.py 22 0 100%
etsy_python/v3/resources/ListingInventory.py 18 0 100%
etsy_python/v3/resources/ListingOffering.py 12 0 100%
etsy_python/v3/resources/ListingProduct.py 12 0 100%
etsy_python/v3/resources/ListingTranslation.py 19 0 100%
etsy_python/v3/resources/ListingVariationImages.py 16 0 100%
etsy_python/v3/resources/ListingVideo.py 22 0 100%
etsy_python/v3/resources/Miscellaneous.py 16 0 100%
etsy_python/v3/resources/Payment.py 23 0 100%
etsy_python/v3/resources/PaymentLedgerEntry.py 15 0 100%
etsy_python/v3/resources/Receipt.py 25 0 100%
etsy_python/v3/resources/ReceiptTransactions.py 27 0 100%
etsy_python/v3/resources/Review.py 16 0 100%
etsy_python/v3/resources/ShippingProfile.py 58 0 100%
etsy_python/v3/resources/Shop.py 23 0 100%
etsy_python/v3/resources/ShopProductionPartner.py 11 0 100%
etsy_python/v3/resources/ShopReturnPolicy.py 28 0 100%
etsy_python/v3/resources/ShopSection.py 25 0 100%
etsy_python/v3/resources/Taxonomy.py 23 0 100%
etsy_python/v3/resources/User.py 14 0 100%
etsy_python/v3/resources/UserAddress.py 19 0 100%
etsy_python/v3/resources/__init__.py 29 0 100%
etsy_python/v3/resources/enums/RateLimit.py 8 0 100%
etsy_python/v3/resources/enums/Request.py 7 0 100%

Updated by PR Tests

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 UpdateListingRequest by using _type (matching model attribute keys).
  • Add missing legacy query param support to batch listings and shop receipt transactions endpoints.
  • Update listing enums (remove invalid State.REMOVED, add Includes.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.

Comment thread etsy_python/v3/resources/ReceiptTransactions.py
Comment thread etsy_python/v3/resources/Listing.py
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@amitray007
Copy link
Copy Markdown
Owner Author

Both Copilot review comments addressed in 09d1b8c — the deprecated aliases get_listings_by_listings_ids and get_shop_receipt_transaction_by_shop now accept and forward the legacy parameter to their canonical methods.

amitray007 and others added 2 commits March 16, 2026 16:27
…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>
@amitray007 amitray007 merged commit 3403db7 into master Mar 16, 2026
6 checks passed
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.

Etsy API drift detected

2 participants