Sync SDK with Etsy API spec — EU commercial guarantee fields, multi-video upload - #43
Merged
Merged
Conversation
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
Contributor
Test Coverage ReportOverall: 100% (1738/1738 statements covered) Coverage by file
Updated by PR Tests |
There was a problem hiding this comment.
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_videosupport 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.
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
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
createDraftListingandupdateListing: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.REMOVEDcomment was stale. The spec addedremovedto 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_videoonupload_listing_video. New query parameter. PassingTruekeeps existing videos on the listing; omitting it preserves the former single-video replace behaviour, byte-identical on the wire to before.specs/audit-ignore.json. They suppressedremovedas 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_descriptionwas removed from theShopListing/ShopListingWithAssociationsresponse schemas. It never appeared in any request body and the SDK never referenced it.ecgt_commercial_guarantee_enabledwas added to response schemas only — server-computed, so no model field.ecgt_garan_brand,model,yearsandguarantee_detailsare documented as required together. Etsy enforces this server-side; no client-side cross-field validation was added, consistent with the rest of the SDK.DeprecationWarning), 8legacyparam entries, 2 personalization body entries, 2 holiday_id entries, 2Includesentries.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 1is_multi_videoresource 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.True→?is_multi_video=true,False→?is_multi_video=false.specs/baseline.jsonupdated to the audited spec.🤖 Generated with Claude Code
https://claude.ai/code/session_01KENB6Bxbu2p4YmfpXh4Ehx