-
Notifications
You must be signed in to change notification settings - Fork 28
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
Can't filter by id #18
Comments
This is expected, I think. Why are you trying to "filter" by ID? If you have the ID of a record, the URL always looks like this:
Not sure what the use case is. |
It's used by Ember to load relationships without making a request for every relationship. In the adapter we can set the {
post: {
id: 1,
comments: [1, 2]
}
} With this option set to false the request will be:
And with the option set to true:
|
Oh, ok. This is an odd case because the JSON API spec says nothing about the |
I don’t think that this is a non-standard feature, it’s likely that is an implicit implementation because the filter must filter any column, independent if is primary key or not. If I figure out how to implement this, i’ll make a pull request. Iago Sousa
|
The spec says absolutely nothing about filtering:
http://jsonapi.org/format/#fetching-filtering So the fact that Ember Data uses the |
The problem is that the filter can be applied to any column except ID, that is also a column. Seems that the script is ignoring the ID as a column. Iago Sousa
|
What I meant was that any sort of filtering is out of the spec, and is ad hoc. For example, if I wanted to filter by aggregate sum of an array of numbers greater than some amount, of course the spec won't bother with that. Any client using the I think that this discussion should belong in JSON API. |
Oh yes, sorry for the misunderstanding. Iago Sousa
|
This is a server strategy and does not rely on specification. |
Actually leave it open, I would like to keep track of it since it's useful for Ember Data. |
The filter is ok, unless you try to filter by the id.
I received this exception.
Unhandled rejection BadRequestError: The field "id" is non-existent.
The text was updated successfully, but these errors were encountered: