- What is paysera/lib-api-bundle used for?
- Paysera API Bundle is a Symfony bundle for building consistent JSON APIs with reusable controller infrastructure, request handling, and standardized error responses. It helps teams keep REST endpoints predictable and aligned across services. It is aimed at Paysera-style API services rather than general-purpose web applications.
- How do I install paysera/lib-api-bundle with Composer?
- Install it with Composer using composer require paysera/lib-api-bundle. Because it is a Symfony bundle, you then register it in your Symfony application and review the bundle configuration. The provided context does not describe a separate migration or config-publish step.
- Does paysera/lib-api-bundle work with Laravel?
- The package is described as a Symfony bundle, and the provided context does not confirm an official Laravel adapter. Laravel teams should treat integration as custom work involving service provider or middleware wiring. If you need a Laravel-native API toolkit, compare it against Laravel-oriented alternatives before adopting it.
- Which Symfony and PHP versions does paysera/lib-api-bundle support?
- The context references CI jobs for Symfony 3.4 and 4.4, both of which are end-of-life and no longer receive upstream security support. It does not provide the declared PHP version constraints. Check composer.json and the tested matrix rather than assuming current Symfony or PHP support.
- How does paysera/lib-api-bundle handle JSON error responses?
- The bundle provides exception-to-error mapping and standardized JSON responses for API endpoints. In version 1.8.2, an unsupported sort field is expected to return 400 invalid_parameters instead of 500 internal_server_error on paginated endpoints. Verify that the response includes a machine-readable error body and that non-paginated endpoints behave the same way.
- How do I configure paysera/lib-api-bundle behavior?
- Behavior is configurable through Symfony bundle configuration. Review the bundle defaults and override them in your application configuration as needed. The context does not list every option, so consult the package documentation and configuration reference for the exact keys.
- Does the bundle validate sort and filter parameters against an allowlist?
- The context confirms a fix for unsupported sort fields returning 400 on paginated endpoints, but it does not confirm allowlist enforcement. Shape validation alone is weaker than validating sort columns against a closed allowlist before they reach the query builder. Treat allowlist enforcement as a key verification item before production use.
- Can I use paysera/lib-api-bundle for pagination, sorting, and filtering?
- The bundle layers query-parameter handling for pagination, sorting, and filtering onto HTTP endpoints. The 1.8.2 change is specifically described as applying to paginated endpoints. Whether non-paginated endpoints also return 400 for an invalid sort is unconfirmed and should be tested.
- What are the production risks of upgrading to paysera/lib-api-bundle 1.8.2?
- The main behavioral change is that an unsupported sort field returns 400 invalid_parameters rather than 500 internal_server_error, so update clients, SDKs, dashboards, retry policies, and alerts that key on 5xx responses. The CI change also permits packages with security advisories for legacy jobs, which weakens the green-build signal. Continuing Symfony 3.4 and 4.4 support means the project tolerates end-of-life framework platforms.
- What alternatives or maintenance considerations exist for paysera/lib-api-bundle?
- For Symfony, evaluate API Platform or other REST/API bundles; for Laravel, prefer Laravel-native API and pagination packages unless you need Paysera-specific behavior. Check the changelog for behavioral-change notes and any deprecation signalling for the 1.x line. Also confirm whether advisory-affected packages are scoped to legacy CI jobs only or affect the whole matrix.