mtgjson / mtgjson-website

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

Wrong Typing for sourceProducts #626

Closed Horsty80 closed 5 months ago

Horsty80 commented 6 months ago

The type of sourceProducts in the typescript file is "string" but I suppose the typing need to be a dedicated type.

https://github.com/mtgjson/mtgjson-website/blob/60a6a65ec8cd028fe9eb58a4d0014c7ae7310ed6/docs/data-models/card/card-set/index.md?plain=1#L575 https://github.com/mtgjson/mtgjson-website/blob/60a6a65ec8cd028fe9eb58a4d0014c7ae7310ed6/docs/data-models/card/card-set/index.md?plain=1#L579

exemple of data

  "sourceProducts": {
    "nonfoil": ["3a10f018-17fe-56a7-91ba-b4bd98678c8d", "c690e178-661d-5e17-9b29-a5bf6319a844"]
  }

expected type

export type SourceProducts = {
    foil?: string[];
    nonfoil?: string[]
}

Maybe I missing other property but clearly the type is not correct in the doc https://mtgjson.com/data-models/card/card-set/#sourceproducts

Capture d’écran 2024-03-14 à 22 48 25
Horsty80 commented 5 months ago

@staghouse it's possible to have the all type for sourceProduct ?

I've found another missing property

sourceProducts: { etched: ["123-XXX] }

So SourceProducts have foil, nonfoil, etched properties, there are another properties ?