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

Suggestion - id and uri properties on objects required by convention. #113

Open
DDtMM opened this issue Oct 15, 2021 · 1 comment
Open

Comments

@DDtMM
Copy link

DDtMM commented Oct 15, 2021

It would be great if all fields that weren't optional were marked as required, but I don't know a reliable way you make that determination from the documentation.

It would be nice if at least the id and uri fields on response objects were required. I think it is more justifiable than other fields to expect this since they are identifiers on the objects. From observation, the id and uri properties are never null when being returned from a request.

The benefit here is that clients that are generated from the specification won't make those two properties nullable. It's minor nuisance having null checks sprinkled throughout code that relies upon generated classes.

Thank you for your consideration.

(maybe all fields could be required unless the phrase "null" is in the description - that seems pretty cheesy though, and can be problematic given some array members can come back null.)

@sonallux
Copy link
Owner

Thanks for your suggestions. I had already considered this as a possible feature to add. But as Spotify is now sourcing its Web API reference documentation from an Open API definition, this whole project is now kind of obsolete. Please also see #114

The Open API definition from Spotify is already marking fields as required in its model definition. Unfortunately currently not for Artists and Playlists, but this will hopefully follow soon.

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

2 participants