-
Notifications
You must be signed in to change notification settings - Fork 9
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
Nullity of fields #14
Comments
In part it will be because I enabled nullable reference types for the code base, Which meant that any field where I could not guarantee a non-null value had to be nullable, to avoid warnings from the compiler. For Note that you can do things like |
Ah ok. It's just that it feels silly to put null checks or e.g.
I hope that maybe you can reconsider this, but I can't force you ;-) |
Another thing is that I've been bitten in the past by the fact that the JSON serialization on MusicBrainz is... not very standardized when it comes to empty fields. Sometimes you get an explicit I suppose I could explictly attempt to not have nulls anywhere, and just map things to |
And obviously fields that are other entity types would need to remain nullable if they're optional, because there's no safe no-allocate "default" value for those. |
I got back to developing an application using this API and while refactoring so that it works with the update I noticed that all fields are suddenly explicitly nullable. Even e.g.
IRecording.Title
is nullable, why it can't actually be null, right? Why is this? It makes programming with the API a bit confusing as now I have to add!
s everywhere or check for nullity when it will never be null.PS: Thanks for maintaining this project!
The text was updated successfully, but these errors were encountered: