Open RuslanZavacky opened 7 years ago
@RuslanZavacky I realized that there no strict description of filter rules in JSONAPI spec. It is up to a developer how to implement filtering operators. I see that it might be a big effort to implement this functionality properly to fit multiple use cases.
Here are some options which I have found:
Here is a discussion on this topic: https://discuss.jsonapi.org/t/share-propose-a-filtering-strategy/257
This is a meta issue to gather full Specification of JSON API and to check what is supported/implemented by this library. (Will add more things, any contribution is welcome)
Each checkmark can be converted into a test case as a result.
Server Responsibilities
Document structure
jsonapi
: an object describing the server’s implementationlinks
: a links object related to the primary data.included
: an array of resource objects that are related to the primary data and/or each other (“included resources”).Resource Objects
id
,type
attributes
: an attributes object representing some of the resource’s data.relationships
: a relationships object describing relationships between the resource and other JSON API resources.links
: a links object containing links related to the resource.meta
: a meta object containing non-standard meta-information about a resource that can not be represented as an attribute or relationship.Identification
Fields
Relationships
links
: a links object containing at least one of the following:self
: a link for the relationship itself (a “relationship link”). This link allows the client to directly manipulate the relationship. For example, removing an author through an article’s relationship URL would disconnect the person from the article without deleting the people resource itself. When fetched successfully, this link returns the linkage for the related resources as its primary data. (See Fetching Relationships.)related
: a related resource linkdata
: resource linkagemeta
: a meta object that contains non-standard meta-information about the relationship.Related Resource Links
Resource Linkage
Resource Links
links
member within each resource object contains links related to the resource. If present, this links object MAY contain a self link that identifies the resource represented by the resource object.Resource Identifier Objects
Compound Documents
Meta Information
Links
JSON API Object
Member Names
Allowed Characters
Fetching Data
Responses
200 OK
404 Not Found
Fetching Relationships
Responses
200 OK
404 Not Found
Inclusion of Related Resources
Sparse Fieldsets
Sorting
Pagination
Filtering
Creating, Updating and Deleting Resources
Creating Resources
Client-Generated IDs
Responses
(will add more a bit later....)