Skip to content
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

Support of JSON:API defined query parameter usage #6841

Open
cay89 opened this issue Dec 4, 2024 · 4 comments
Open

Support of JSON:API defined query parameter usage #6841

cay89 opened this issue Dec 4, 2024 · 4 comments

Comments

@cay89
Copy link
Contributor

cay89 commented Dec 4, 2024

Description
API Platform supports JSON:API format but only for request/response body. However the JSON:API specification is not limited to this. It specifies the usage of query parameters for sorting, pagination and filtering too.

Example

Sorting:

GET /people?sort=age HTTP/1.1
Accept: application/vnd.api+json
GET /people?sort=age,name HTTP/1.1
Accept: application/vnd.api+json
GET /articles?sort=-created,title HTTP/1.1
Accept: application/vnd.api+json

Pagination:

GET /?page[offset]=0&page[limit]=10

Filtering:

GET /posts?sort=author.name&filter[author.status]=active
@soyuka
Copy link
Member

soyuka commented Dec 8, 2024

yes these are implemented are you using Laravel?

@cay89
Copy link
Contributor Author

cay89 commented Dec 9, 2024

@soyuka Yes, I am using Laravel.

@cay89
Copy link
Contributor Author

cay89 commented Dec 9, 2024

But I couldn't find any example or info in the documentation for this.

@soyuka
Copy link
Member

soyuka commented Dec 16, 2024

I forgot to load the JsonApiProvider I'll do a few tests and let you know how this works asap.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants