Skip to content

Sync SDK with Etsy API spec — EU commercial guarantee fields, multi-video upload - #43

Merged
amitray007 merged 2 commits into
masterfrom
release/sdk-audit-2026-09-21
Sep 21, 2026
Merged

amitray007 merged 2 commits into
masterfrom
release/sdk-audit-2026-09-21

Conversation

@amitray007

Copy link
Copy Markdown
Owner

Summary

Full SDK audit against the current Etsy OAS spec. Coverage stays at 100% (105/105 operations); every change below comes from this spec update. No new Etsy GitHub releases since 2026-03-24, so the spec diff was the only source.

Found 3 Must Fix, 2 Should Fix, 4 Informational.

Must Fix

  • EU commercial guarantee (ECGT/GPSR) fields. The spec added seven request-body fields to createDraftListing and updateListing: ecgt_garan_brand, ecgt_garan_model, ecgt_garan_years, ecgt_garan_guarantee_details, ecgt_other_commercial_guarantee_details, ecgt_after_sales_service_info, ecgt_software_update_details. Callers previously had no way to send EU guarantee data on create or update — a compliance-relevant gap for eligible EU traders. All are optional and nullable, and both models share them via _ECGTFieldsMixin, mirroring the existing personalization mixin.
  • State.REMOVED comment was stale. The spec added removed to the listing state enum, so the inline "Not in OAS spec; kept for backward compatibility" note was no longer true. The value is correct; only the comment changed.

Should Fix

  • is_multi_video on upload_listing_video. New query parameter. Passing True keeps existing videos on the listing; omitting it preserves the former single-video replace behaviour, byte-identical on the wire to before.
  • Three stale entries removed from specs/audit-ignore.json. They suppressed removed as an SDK-only extra value. The spec now defines it, so they matched nothing and were being reported under Stale Ignores every run.

Informational — no code impact

  • rich_description was removed from the ShopListing / ShopListingWithAssociations response schemas. It never appeared in any request body and the SDK never referenced it.
  • ecgt_commercial_guarantee_enabled was added to response schemas only — server-computed, so no model field.
  • ecgt_garan_brand, model, years and guarantee_details are documented as required together. Etsy enforces this server-side; no client-side cross-field validation was added, consistent with the rest of the SDK.
  • Re-verified all remaining suppressions as still valid: 4 deprecated aliases (each still delegates and emits DeprecationWarning), 8 legacy param entries, 2 personalization body entries, 2 holiday_id entries, 2 Includes entries.

Deliberately not done

No client-side range check on ecgt_garan_years (spec documents 3–99). The SDK has no precedent for client-side range validation, Etsy enforces it server-side, and a local check risks rejecting values Etsy later accepts.

Test plan

  • pytest — 440 passed, no new warnings. Adds 6 ECGT model tests (serialization of all seven fields on both models, omission when unset, nullable-clearing, and no spurious deprecation warning) and 1 is_multi_video resource test.
  • python scripts/audit_sdk.py --spec specs/latest.json — 100% coverage, no request body drift, no query/path param drift, no stale ignores, 0 code issues.
  • python scripts/check_version_consistency.py — OK at 1.2.0.
  • Verified query-string serialization end to end: unset sends no parameter, True → ?is_multi_video=true, False → ?is_multi_video=false.
  • Verified mixin MRO introduces no property shadowing, ECGT values reach the wire, and the deprecated personalization fields remain excluded.
  • specs/baseline.json updated to the audited spec.

🤖 Generated with Claude Code

https://claude.ai/code/session_01KENB6Bxbu2p4YmfpXh4Ehx

amitray007 and others added 2 commits September 21, 2026 23:12
Audit against the 2026-09 Etsy OAS spec. Coverage stays at 100% (105/105
operations); all findings below come from this spec update.

Must fix:
- Add the seven EU commercial guarantee (ECGT/GPSR) request-body fields to
  CreateDraftListingRequest and UpdateListingRequest: ecgt_garan_brand,
  ecgt_garan_model, ecgt_garan_years, ecgt_garan_guarantee_details,
  ecgt_other_commercial_guarantee_details, ecgt_after_sales_service_info and
  ecgt_software_update_details. All optional and nullable. Callers previously
  had no way to send EU guarantee data on create or update. Shared by both
  models via _ECGTFieldsMixin, matching the existing personalization mixin.
- Drop the stale "Not in OAS spec" comment on State.REMOVED. The spec added
  'removed' to the listing state enum, so the value is now in sync.

Should fix:
- Add is_multi_video to upload_listing_video. Passing True keeps existing
  videos; omitting it preserves the former single-video replace behaviour.
- Remove three stale entries from specs/audit-ignore.json. They suppressed
  'removed' as an SDK-only extra value; the spec now defines it, so they
  matched nothing and were reported under Stale Ignores.

No SDK impact from the response-only changes: ecgt_commercial_guarantee_enabled
is server-computed, and rich_description never appeared in a request body.

Tests: 440 passed. Baseline updated to the current spec.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KENB6Bxbu2p4YmfpXh4Ehx
Replace the simplefilter("error") idiom in test_ecgt_does_not_warn with a
recorded-warnings assertion, so the test states its intent rather than
relying on an exception to fail the run. Verified non-vacuous: a deprecated
personalization field still produces a warning this assertion catches.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KENB6Bxbu2p4YmfpXh4Ehx
@amitray007 amitray007 added enhancement New feature or request python Pull requests that update python code api-drift Auto-created when Etsy API spec changes are detected by weekly maintenance check labels Sep 21, 2026
@amitray007 amitray007 self-assigned this Sep 21, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Test Coverage Report

Overall: 100% (1738/1738 statements covered)

Coverage by file
File Statements Missing Coverage
etsy_python/__init__.py 2 0 100%
etsy_python/_version.py 1 0 100%
etsy_python/v3/auth/OAuth.py 33 0 100%
etsy_python/v3/auth/__init__.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/common/Utils.py 34 0 100%
etsy_python/v3/enums/HolidayPreferences.py 29 0 100%
etsy_python/v3/enums/Language.py 12 0 100%
etsy_python/v3/enums/Listing.py 78 0 100%
etsy_python/v3/enums/ListingInventory.py 4 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/BaseAPIException.py 10 0 100%
etsy_python/v3/exceptions/RequestException.py 8 0 100%
etsy_python/v3/exceptions/__init__.py 2 0 100%
etsy_python/v3/models/FileRequest.py 7 0 100%
etsy_python/v3/models/HolidayPreferences.py 8 0 100%
etsy_python/v3/models/Listing.py 189 0 100%
etsy_python/v3/models/Miscellaneous.py 8 0 100%
etsy_python/v3/models/ProcessingProfile.py 21 0 100%
etsy_python/v3/models/Product.py 7 0 100%
etsy_python/v3/models/Receipt.py 39 0 100%
etsy_python/v3/models/Request.py 22 0 100%
etsy_python/v3/models/ShippingProfile.py 85 0 100%
etsy_python/v3/models/Shop.py 24 0 100%
etsy_python/v3/models/ShopReturnPolicy.py 25 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 19 0 100%
etsy_python/v3/resources/Listing.py 102 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 25 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/ProcessingProfile.py 26 0 100%
etsy_python/v3/resources/Receipt.py 25 0 100%
etsy_python/v3/resources/ReceiptTransactions.py 27 0 100%
etsy_python/v3/resources/Response.py 9 0 100%
etsy_python/v3/resources/Review.py 16 0 100%
etsy_python/v3/resources/Session.py 94 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

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot review overview

🟢 Approval recommended

All reviewed changes are covered by tests and no unresolved blocking issues remain.

Review effort: Lite
Findings: None

What changed in this PR

Synchronizes the SDK with Etsy’s updated API specification.

Changes:

  • Adds ECGT/GPSR fields to listing request models.
  • Adds is_multi_video support to video uploads.
  • Updates API specs, enum metadata, audit suppressions, and tests.
File Description
tests/​test_remaining_resources.py Tests multi-video upload parameters.
tests/​test_listing_models.py Tests ECGT field serialization and nullability.
specs/​baseline.json Updates the API schema baseline.
specs/​audit-ignore.json Removes obsolete suppressions.
etsy_python/​v3/​resources/​ListingVideo.py Supports multi-video uploads.
etsy_python/​v3/​models/​Listing.py Adds shared ECGT request fields.
etsy_python/​v3/​enums/​Listing.py Updates REMOVED enum metadata.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@amitray007
amitray007 merged commit 0bd2f8b into master Sep 21, 2026
10 checks passed
@amitray007 amitray007 linked an issue Sep 21, 2026 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api-drift Auto-created when Etsy API spec changes are detected by weekly maintenance check enhancement New feature or request python Pull requests that update python code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

audit: Spec Drift [2026-09-21] — medium

2 participants