Repository navigation
Release 2.0
Complete rewrite of Sabservis API framework.
Breaking changes:
- Replace PSR-7 with custom ApiRequest/ApiResponse
- Replace zircote/swagger-php with native PHP 8 attributes
- Replace API Mapper with igorpocta/data-mapper
Features:
- File uploads with server-side MIME validation
- FileResponse for secure file downloads
- ApiTestClient for integration testing
- Multi-value headers (Set-Cookie support)
- Automatic DTO injection in controllers
- BackedEnum mapping by value and case name
- IPv6 CIDR support in trusted proxies
- RequestIdMiddleware for distributed tracing
- Alias attribute for multiple endpoint paths
- ListResponse with optional pagination meta
- Static factories: ApiResponse::ok(), created(), noContent(), list()
Security:
- Trusted proxies configuration
- Request body size limit (pre-memory)
- Content-Type/Content-Length validation
- 0-byte file upload rejection
- CORS credentials + wildcard blocking
- Sensitive data sanitization in exceptions
- X-Content-Type-Options: nosniff
- Header injection protection
- Symlink blocking in FileResponse
DX:
- Typed methods: getEndpoint(), getRouteParams(), getTypedEntity()
- RequestAttributes enum
- Better error messages with examples
- Middleware configuration validation