messere / partial-response-middleware
Filter out not needed fields from API response.
0.1.1
2020-02-14 18:08 UTC
Requires
- php: ^7.1
- ext-json: *
- messere/php-value-mask: ^0.1.1
- middlewares/utils: ^1.2
- psr/http-server-middleware: ^1.0
Requires (Dev)
- laminas/laminas-diactoros: ^2.2
- phpmd/phpmd: ^2.6
- phpunit/phpunit: ^8.0
- squizlabs/php_codesniffer: ^3.3
This package is auto-updated.
Last update: 2024-11-15 04:15:10 UTC
README
Purpose
Google in their Performance Tips for
APIs, suggest to limit required bandwidth by filtering out unused fields in response. Their APIs
support additional URL parameter fields
which asks API to include only specific fields in response.
This project wraps php-value-mask library (which provides filter parsing and filtering) in PSR-15 middleware, which can be used with standards compatible frameworks.
See php-value-mask project for more details on filtering syntax.
Acknowledgements
- Google's API performance tips.
- Some helpers from Middlewares projects were used