micro-module / rest-bundle
Reusable REST API infrastructure bundle: API versioning, base controllers, DTO mapping, JSON path filtering, event listeners, CSRF protection, and pagination/HATEOAS traits
Package info
github.com/temafey/micro_modules_rest_bundle
Type:symfony-bundle
pkg:composer/micro-module/rest-bundle
v0.1.0
2026-03-29 20:21 UTC
Requires
- php: ^8.4
- micro-module/base: ^0.12 || ^0.13 || ^0.14
- psr/log: ^2.0 || ^3.0
- symfony/config: ^7.0 || ^8.0
- symfony/dependency-injection: ^7.0 || ^8.0
- symfony/event-dispatcher: ^7.0 || ^8.0
- symfony/framework-bundle: ^7.0 || ^8.0
- symfony/http-foundation: ^7.0 || ^8.0
- symfony/http-kernel: ^7.0 || ^8.0
- symfony/routing: ^7.0 || ^8.0
Requires (Dev)
- doctrine/dbal: ^4.4
- mockery/mockery: ^1.6
- nyholm/symfony-bundle-test: ^3.0
- phpstan/phpstan: ^2.0
- phpstan/phpstan-mockery: ^2.0
- phpstan/phpstan-phpunit: ^2.0
- phpunit/phpunit: ^11.0
- ramsey/uuid: ^4.0
- symfony/json-path: ^7.3 || ^8.0
- symfony/object-mapper: ^7.3 || ^8.0
- symfony/security-csrf: ^7.0 || ^8.0
- symplify/easy-coding-standard: ^12.0
Suggests
- doctrine/dbal: Required for HealthCheckController database checks
- ramsey/uuid: Required for ProcessUuidListener and UuidToStringTransform
- symfony/json-path: Required for JsonPathFilter component
- symfony/object-mapper: Required for DtoMapper component
- symfony/security-csrf: Required for StatelessCsrfTokenService and CsrfTokenValidationListener
This package is auto-updated.
Last update: 2026-03-29 20:22:10 UTC
README
Reusable REST API infrastructure bundle for Symfony-based microservices. Provides standardized HTTP-layer components to eliminate duplication across projects.
Features
- API Versioning — Version manager, resolver, registry, and response builder
- Base Controllers — Abstract API controller with common REST patterns
- DTO Mapping — Symfony ObjectMapper integration with custom transforms (UUID, DateTime)
- JSON Path Filtering — Response field filtering via JSON Path expressions
- Event Listeners — API versioning, process UUID, trailing slash redirect, domain exception handling
- CSRF Protection — Stateless CSRF token service and validation listener
- Pagination & HATEOAS Traits — Pagination, resource links, and JSON path filter traits
Installation
composer require micro-module/rest-bundle
Configuration
Register the bundle in config/bundles.php:
return [ // ... MicroModule\Rest\RestBundle::class => ['all' => true], ];
Requirements
- PHP ^8.4
- Symfony ^7.0 || ^8.0
Optional Dependencies
symfony/object-mapper— for DtoMapper componentsymfony/json-path— for JsonPathFilter componentramsey/uuid— for ProcessUuidListener and UuidToStringTransformsymfony/security-csrf— for CSRF protection components
License
Proprietary