mtgjson / mtgjson-website

MTGJSON Documentation Front-End Application built with VitePress
https://mtgjson.com
MIT License
36 stars 24 forks source link

Deck[] / DeckSet[] data structure mixed around #616

Closed GaryTheHutt closed 7 months ago

GaryTheHutt commented 8 months ago

The data structure of the AllPrintings file not as described in documentation:

Location of update needed

https://mtgjson.com/data-models/set/ https://mtgjson.com/data-models/deck/ https://mtgjson.com/data-models/deck-set/

What does the documentation look like?

The TypeScript model states that the Set Data Model uses "decks: DeckSet[]".

What should the documentation look like?

It actually uses some hybrid of Deck[] which includes all fields described for that model except fileName but then adds sealedProductUuids from the DeckSet[] with one or two overlapping fields described for both models being present. The "cards" field with CardSetDeck[] data does not appear to be available , but the "commander", "mainBoard", and "sideBoard" fields contain a close approximation that uses "isFoil" instead of "finishes". The CardDeck Data Model documented for Deck[] is not included (and shouldn't be since the "cards" field already contains that information). In reality, the data is not structured in a way described completely by either model, but they seem closest to Deck[] if it only contained counts and uuids like described in DeckSet[] instead of of full card data.

Additional context

The entire documentation of the "decks" field and its subfields within the Sets Data Model for the AllPrintings file (and possibly others; I haven't checked) needs an update/overhaul.

staghouse commented 7 months ago

Thanks for the feedback! Just so I understand correctly...

  1. Deck (Set) is all sorts of wrong.
  2. Card (Set Deck) should not have finishes property but instead an optional isFoil property.
  3. Set is referencing a decks property as always available, when it should be optionally referencing Deck (Set)

These are the two files I used as a reference:

Additionally I noticed that Deck has a fileName property that does not actually exist in the model, and the commander property returns an array of relevant Card models since a deck can have more than 1 commander.

Have I captured everything you are noticing?