Document sourceProducts as a Source Products object on Deck and Token cards - #733
Merged
Merged
Conversation
… cards
Card (Deck) and Card (Token) still described sourceProducts as a flat
string[] of Sealed Product uuids. It is actually the same SourceProducts
object already documented on Card (Set) — a mapping of finish (etched,
foil, nonfoil) to the uuids of the products that finish is found in.
Confirmed in the data (every card in AzaarLichlord_PAST.json carries
{"nonfoil": [...]}) and upstream, where CardSet, CardDeck and CardToken
all declare source_products as SourceProducts; the Deck and Token fields
just carry a stale type_override of "string[]".
Also lists Card (Deck) and Card (Token) as parent models on the Source
Products page, matching how Identifiers and SKU IDs name every parent.
Fixes #642
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Xba7S7uYsrKAVdniqNcfhS
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #733 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 1 1
Lines 69 69
Branches 27 27
=========================================
Hits 69 69 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
Fixes #642
Card (Deck) and Card (Token) still described
sourceProductsas a flatstring[]of Sealed Product uuids. It is actually the sameSourceProductsobject already documented on Card (Set) — a mapping of finish (etched,foil,nonfoil) to the uuids of the products that finish is found in. #632 fixed Card (Set) when it addressed #626–628, but left the identical field on the other two models untouched.Verified two ways:
AzaarLichlord_PAST.json(the reporter's example) carriessourceProductsas an object like{"nonfoil": [...]}, never a flat array.mtgjson5/models/cards.py,CardSet,CardDeckandCardTokenall declaresource_products: SourceProducts | None. The Deck and Token fields just carry a stalejson_schema_extra={"type_override": "string[]"}and the old description, which is why the generated docs came out wrong — Card (Set) has no such override.Also lists Card (Deck) and Card (Token) as parent models on the Source Products page, matching how Identifiers and SKU IDs name every parent.
npm run generate:typesnow emitssourceProducts?: SourceProductsinCardDeck.tsandCardToken.ts, in line withCardSet.ts. markdownlint is clean on all three changed files.The other half of #642 — that Source Products' own fields are documented as required but are often absent — was handled by #732.
Note: the root cause is upstream in mtgjson/mtgjson. Until the
type_overrideis dropped fromCardDeck.source_productsandCardToken.source_productsthere, the next--generate-docsrun will overwrite this fix.🤖 Generated with Claude Code
https://claude.ai/code/session_01Xba7S7uYsrKAVdniqNcfhS