8000 Adding include, filter, sort... on Related Resource · Issue #77 · cloudcreativity/laravel-json-api · GitHub
[go: up one dir, main page]

Skip to content
Adding include, filter, sort... on Related Resource #77
Closed
@JeanLucEsser

Description

@JeanLucEsser

Hi there,

I'm almost done updating my full application to this library, which btw is simply amazing, only to face a last minute issue. Let me explain. Consider a Post with many Comments.

Using related resources I can have the following endpoint:
/api/posts/{post_id}/comments

Now I would like to implement pagination on this and I know it is on the path to 1.0, that's awesome news. But I also need to be able to include other resources or apply some filters.

But the following doesn't work:
/api/posts/{post_id}/comments?include=author&filter[title]=hello

I would have expected that it would be parsed by the Comment Adapter and Validator.
I don't see anything in the spec preventing filtering or inclusion on related resources, unless I missed it.

Sure I could achieve the same result by adding a filter on the comments endpoint:
/api/comments?include=author&filter[title]=hello&filter[posts-id]={post_id}

But that's not how my API is documented and isn't the best way of doing it.

Is it something which is on the radar? Maybe on the road to 1.0?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0