Skip to content

Update filtering to define strict matching in collections (arrays) and to-many relationships. #267

Description

@jgornick

The current "Filtering" spec says:

This specification only supports filtering based upon strict matching.

This is great, however, it doesn't mention anything about filtering on collections (arrays) or to-many relationships.

To take the existing example of filtering on "author", let's assume that there are multiple "authors" for a single post:

{
    "id": "1",
    "title": "Rails is Omakase",
    "links": {
      "authors": ["17", "19", "21"]
    },
    "tags": ["foo", "bar"]
}

To filter posts on the to-many relationship of authors by value "19", I would expect the request to be:

GET /posts?authors=19

When a filter condition is provided for a collection (array) or to-many relationship, I would expect it to filter posts where the value of 19 is IN the authors collection.

Another example would be to filter posts by a tag:

GET /posts?tags=bar

I would expect the results to include posts that had the value of "bar" in the tags array.

Thoughts?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions