python-tidal icon indicating copy to clipboard operation
python-tidal copied to clipboard

Align type definitions with OpenAPI spec

Open multimeric opened this issue 4 months ago • 1 comments

There are a couple of fields whose types I'm not sure about.

For example, various album fields like name, explicit etc are defined to be optional: https://github.com/EbbLabs/python-tidal/blob/67581e89aa0da66b64028f1e41bdfe197cac53b2/tidalapi/album.py#L45-L71

But in the Tidal OpenAPI spec they are required:

curl https://tidal-music.github.io/tidal-api-reference/tidal-api-oas.json | jq .components.schemas.Albums_Attributes.required
[
  "barcodeId",
  "duration",
  "explicit",
  "mediaTags",
  "numberOfItems",
  "numberOfVolumes",
  "popularity",
  "title",
  "type"
]

IDs are also required just based on the JSON:API spec.

Are you happy with a PR to align these types with the OpenAPI spec?

multimeric avatar Aug 20 '25 13:08 multimeric

FYI tidalapi is developed by reverse engineering the closed API and is therefore not directly corresponding with the OpenAPI.

So before making such changes, it is necessary to make sure the closed API and OpenAPI endpoints actually use the same type definitions. It's likely that they follow a similar spec, but it would need to be verified by making experiments IMO.

PRs are of course very welcome 👍

tehkillerbee avatar Aug 20 '25 15:08 tehkillerbee