Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Which fields are nullable and which are required? #92

Open
WillSmithTE opened this issue Nov 9, 2023 · 2 comments
Open

Which fields are nullable and which are required? #92

WillSmithTE opened this issue Nov 9, 2023 · 2 comments

Comments

@WillSmithTE
Copy link

The docs specify some fields as required and some nullable, but most have no annotation.

E.g. artists

followers.href says nullable, so I assumed the unmarked fields were required. In reality, at least followers, genres and images have shown to be nullable. Which fields are actually required? Can I rely on name?

Artists is just an example, I'm wondering the same for all models.

Thanks a lot!

@oobayly
Copy link

oobayly commented Jan 15, 2024

This also applies to the images property of the Playlist interface. I had assumed that the type was always going to be an empty array and was getting a run-time error as the API was returning null.

Admittedly, the library is correctly following the documentation "Images for the playlist. The array may be empty or contain up to three images." (emphasis mine), so it's the API at fault here.

@adpadillar
Copy link

adpadillar commented Jan 25, 2024

Same with tracks.preview_url. Type says string but getting null at runtime. This field is shown as nullable in the API reference, but typed as string instead of string | null

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants