xiaohutai / jsonapi

[Bolt Extension] JSON API for Bolt CMS
https://market.bolt.cm/view/bolt/jsonapi
MIT License
55 stars 18 forks source link

Filtering with empty value #64

Open tameroski opened 7 years ago

tameroski commented 7 years ago

json/contenttype?filter[field]= returns all entries instead of entries with field value empty. Not sure this is the desired behaviour, is it ?

xiaohutai commented 7 years ago

I'm not entirely sure if it should work like that, maybe try ?filter[field]=! instead?

Edit: No never mind what I said, that's only for checking non-empty. I don't think you can filter for empty values.

xiaohutai commented 6 years ago

Leaving this ticket open so that others may see.

JSON API does not support this (issue might be outdated) and as far as I know, Bolt doesn't either.

I think the problem is then empty string vs null.

Depending on what you want, you can:

jimcue commented 5 years ago

Looks like it might be an option now? https://github.com/json-api-dotnet/JsonApiDotNetCore/pull/387