I have a concrete situation where I do not understand what to use between 400 and 404.
My situation: I have sort and filtering option.
url/sort=test
-
If test is a property that is not available to be sort is that 400 or 404? I want to go with 400 but I can’t explain why, I have read others and is that even a malformed syntax? This is probably beyond that.
-
url/filter=‘statuses’==DONE, statuses cannot be used to filter, I have documented fields but statuses is not one of them. But here is interesting dilemma that I do not understand, from rfc 404 – not found, server did not find a current representation for the target resource. To paraphrase I want to get resources by filtering them, but option I am using to filter is not available… what is the difference between this situation for example trying to get a resource by invalid id, for example null. I have seen APIs returned 404 for id null, but why this is not a malformed syntax?
I just need clarification and concrete explanations. Feel genuinely lost.