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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

馃悰 Micro caching middleware includes omitted pagination attributes #519

Open
1 task done
pushrbx opened this issue Feb 28, 2024 · 0 comments
Open
1 task done
Labels

Comments

@pushrbx
Copy link
Collaborator

pushrbx commented Feb 28, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

When requesting an endpoint which has pagination, e.g. /v4/top/manga?limit=8&page=1 and if you request it again, then laravel's built in pagination attributes get added.

E.g. first response is:

{
  "pagination": {...}
  "data": [...]
}

When this is not cached.

Second response is:

{
  "pagination": {...}
  "data": [...],
  "meta": {...},
  "links": {...}
}

Expected Behavior

In every response the "links" and "meta" attributes should be omitted.
All the resource classes currently explicitly exclude the "meta" and "links" attributes and explicitly set "data" and "pagination" attributes for the json response. The caching middlewares should do the same.

Steps To Reproduce

  1. Enable microcaching and caching in the .env file
  2. Startup a jikan instance via containers or simply with php dev server
  3. Make a request to an endpoint with pagination and set the limit parameter to a smaller number than 25.
  4. E.g. http://localhost:8091/v4/top/anime?limit=8&page=1
  5. Refresh several times and check for the attribute names in the root json object of the response.

Environment

- Self-hosting
- Microcaching and caching enabled
- Container environment
- Using roadrunner

Anything else?

No response

@pushrbx pushrbx added the bug label Feb 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant