-
-
Notifications
You must be signed in to change notification settings - Fork 158
WIP: Support Filtering using ne:null on nullable attribute #386
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
WIP: Support Filtering using ne:null on nullable attribute #386
Conversation
what if I add two FilterOperations for |
@NullVoxPopuli good idea! But this issue with null is quite confusing. I think you were right with previous solution ?filter[nullable-attr]=NULL or filter[nullable-attr]=ne:NULL. Edit: For error Could not cast null to Nullable'1, Ternary operator should return same type of value. |
but what if someone wants to test for the string value of |
Yeah, thats the problem of string stored NULL values. |
what's to stop the usage of |
Here is null value like every other value after colon. So there must be conversion to null in this case. Maybe someone comes with better idea. |
cool. I'll submit a different PR with |
BUG FIX
The root of this was that I wanted to be able to
?filter[nullable-field]=ne:
, meaning that I wanted all resources wherenullable-field
had a value.I had originally tried using
?filter[nullable-field]=ne:null
but, this was interpretingnull
as"null"
, which resulted in the error:Could not cast null to Nullable'1
.Since checking if something is not null can be handy, I added a check for the
Nullable
generic type, and if the value is an empty string, swap it out for null. :-\This may be a breaking change. idk.