You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In linked data, fundamentally the absence of a true value does not necessarily mean false.
However in practice, they do overlap often (i.e. the frontend needs to handle them in the same way)
As of right now, it is possible to achieve this for booleans with:
This is a bit cumbersome, and the mistake of forgetting to check for the "null case" is easily made.
I'd propose a search modifier:
filter[:truthy:property]: false
which handles the null case with absence of value being treated as false.
Theres various discussions that can be had about what values should be considered truthy, but I'd propose a conservative "any existing value that is not explicitly the boolean "false""
with "boolean" here being defined as "whatever gets serialized to a json boolean in the response"
It could also be made configurable to consider things like numerical 0 or the empty string as falsy, but that might make it more difficult to understand stacks that have a different config that one is used to.
Another option is to follow truthyness rules from javascript, which people are most familiar with.
But this issue is at least the start of discussion.
The text was updated successfully, but these errors were encountered:
In linked data, fundamentally the absence of a true value does not necessarily mean false.
However in practice, they do overlap often (i.e. the frontend needs to handle them in the same way)
As of right now, it is possible to achieve this for booleans with:
This is a bit cumbersome, and the mistake of forgetting to check for the "null case" is easily made.
I'd propose a search modifier:
filter[:truthy:property]: false
which handles the null case with absence of value being treated as false.
Theres various discussions that can be had about what values should be considered truthy, but I'd propose a conservative "any existing value that is not explicitly the boolean "false""
with "boolean" here being defined as "whatever gets serialized to a json boolean in the response"
It could also be made configurable to consider things like numerical 0 or the empty string as falsy, but that might make it more difficult to understand stacks that have a different config that one is used to.
Another option is to follow truthyness rules from javascript, which people are most familiar with.
But this issue is at least the start of discussion.
The text was updated successfully, but these errors were encountered: