@@ -8,48 +8,57 @@ FastOpenAPI follows the [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
88
99### Added
1010
11- - ** Dependency Injection system** with ` Depends ` and ` Security ` classes for automatic dependency resolution
12- - Request-scoped dependency caching with circular dependency detection
13- - Security scopes validation with OAuth2 support
11+ - ** Dependency Injection system** with ` Depends ` and ` Security ` for automatic dependency resolution
12+ - Request-scoped caching (same dependency called multiple times returns cached result)
13+ - Circular dependency detection
14+ - ` SecurityScopes ` injection for OAuth2 scope validation
15+ - Generator/yield dependencies with proper cleanup (sync and async)
1416- ** FastAPI-style parameter classes** : ` Query ` , ` Path ` , ` Header ` , ` Cookie ` , ` Body ` , ` Form ` , ` File `
15- - Full Pydantic v2 validation support for all parameter types (gt, ge, lt, le, min_length, max_length, pattern, etc)
16- - Parameter documentation support (description, examples, deprecated flags)
17- - Pre-defined parameter types: ` PositiveInt ` , ` NonNegativeInt ` , ` PositiveFloat ` , ` NonEmptyStr ` , ` LimitedStr `
17+ - Full Pydantic v2 validation: ` gt ` , ` ge ` , ` lt ` , ` le ` , ` min_length ` , ` max_length ` , ` pattern ` , ` multiple_of ` , ` strict ` , etc.
18+ - Parameter metadata: ` description ` , ` title ` , ` example ` , ` examples ` , ` deprecated `
19+ - Alias support for headers and query parameters
20+ - ** Django support** with ` DjangoRouter ` (sync) and ` DjangoAsyncRouter ` (async), including ` urls ` property for Django URL patterns
21+ - ** Falcon async support** with ` FalconAsyncRouter ` (in addition to existing sync ` FalconRouter ` )
1822- ` FileUpload ` class for framework-agnostic file handling with ` .read() ` and ` .aread() ` methods
23+ - Form data and file upload extraction for all frameworks
1924- ` RequestData ` unified container for request data across all frameworks
2025- ` Response ` class for custom responses with headers and status codes
21- - ** Django support** with ` DjangoRouter ` (sync) and ` DjangoAsyncRouter ` (async)
22- - Built-in OpenAPI security scheme definitions: Bearer JWT, API Key (header/query), Basic Auth, OAuth2
23- - Configurable security schemes via ` security_scheme ` parameter in router constructor
24- - Automatic security scheme integration in OpenAPI documentation
25- - ` APIError.from_exception() ` method for converting any exception to standardized format
26- - Thread-safe caching for parameter models, function signatures, and Pydantic schemas
27- - Modular architecture with dedicated packages: ` core/ ` , ` errors/ ` , ` openapi/ ` , ` resolution/ ` , ` response/ ` , ` routers/ `
28- - ` RouteInfo ` dataclass for type-safe route metadata
29- - Enhanced OpenAPI schema generation with ` SchemaBuilder ` , ` ParameterProcessor ` , and ` ResponseBuilder ` helper classes
30- - Comprehensive error schema generation in OpenAPI documentation
31- - Support for all parameter sources in OpenAPI (path, query, header, cookie, body, form, file)
26+ - Response model validation via ` TypeAdapter ` with thread-safe caching
27+ - ** Standardized error hierarchy** : ` APIError ` , ` BadRequestError ` , ` ValidationError ` (422), ` AuthenticationError ` , ` AuthorizationError ` , ` ResourceNotFoundError ` , ` ResourceConflictError ` , ` InternalServerError ` , ` ServiceUnavailableError ` , ` DependencyError ` , ` CircularDependencyError ` , ` SecurityError `
28+ - ` APIError.from_exception() ` for converting any exception to standardized JSON format
29+ - ` EXCEPTION_MAPPER ` on routers for framework-specific exception conversion (e.g., Django's ` PermissionDenied ` → ` AuthorizationError ` )
30+ - Built-in OpenAPI security schemes: Bearer JWT, API Key (header/query), Basic Auth, OAuth2
31+ - Custom security schemes via ` security_scheme ` parameter (accepts ` SecuritySchemeType ` enum or raw dict)
32+ - Security scheme merging in ` include_router() `
33+ - ` SecuritySchemeType ` exported from ` fastopenapi ` for public use
34+ - Documentation completely rewritten with guides, API reference, framework-specific pages, and examples
3235
3336### Changed
3437
35- - ** Complete architecture refactor** from monolithic to modular design using composition over inheritance
36- - Router implementation changed from inheritance-based to composition-based using ` BaseAdapter ` pattern
37- - Moved parameter resolution from ` BaseRouter.resolve_endpoint_params() ` to dedicated ` ParameterResolver ` class
38- - Moved OpenAPI generation from ` BaseRouter.generate_openapi() ` to dedicated ` OpenAPIGenerator ` class
39- - Moved response serialization from ` BaseRouter._serialize_response() ` to ` ResponseBuilder ` class
40- - Split OpenAPI generation into focused helper classes for better separation of concerns
41- - Reorganized error handling from ` error_handler.py ` module to ` errors/ ` package
42- - Split ` base_router.py ` into multiple focused modules with single responsibility
43- - Route metadata structure changed from tuple to ` RouteInfo ` dataclass for better type safety
44- - Router constructor signature updated with ` security_scheme ` parameter (default: ` SecuritySchemeType.BEARER_JWT ` )
38+ - ** Complete architecture refactor** from monolithic ` base_router.py ` to composition-based modular design:
39+ - ` core/ ` — ` BaseRouter ` , parameter classes, dependency resolver, types, constants
40+ - ` resolution/ ` — ` ParameterResolver ` (extracted from ` BaseRouter.resolve_endpoint_params() ` )
41+ - ` response/ ` — ` ResponseBuilder ` (extracted from ` BaseRouter._serialize_response() ` )
42+ - ` openapi/ ` — ` OpenAPIGenerator ` , ` SchemaBuilder ` , UI renderers (extracted from ` BaseRouter.generate_openapi() ` )
43+ - ` errors/ ` — error hierarchy (extracted from ` error_handler.py ` )
44+ - ` routers/ ` — ` BaseAdapter ` + per-framework packages with separate extractors
45+ - All framework routers now inherit from ` BaseAdapter ` instead of ` BaseRouter `
46+ - Each framework router split into separate router and extractor modules
47+ - Route metadata stored in ` RouteInfo ` class (was tuple)
48+ - Validation errors now return HTTP 422 (was 400)
49+ - OpenAPI ` summary ` resolved from route metadata or formatted endpoint name; ` description ` from metadata or docstring
50+ - Improved import errors with ` MissingRouter ` raising ` ImportError ` when framework is not installed
51+ - ` django ` added as optional dependency extra
4552
4653### Deprecated
4754
48- - Importing from ` fastopenapi.error_handler ` module (use ` from fastopenapi.errors import ... ` instead) - will show deprecation warning
55+ - Importing from ` fastopenapi.error_handler ` module (use ` from fastopenapi.errors import ... ` instead)
4956
5057### Removed
51- - ` BaseRouter.generate_openapi() ` method (use ` router.openapi ` property instead)
52- - Internal API methods for custom router developers: ` resolve_endpoint_params() ` and ` _serialize_response() `
58+
59+ - ` BaseRouter.generate_openapi() ` method (use ` router.openapi ` property)
60+ - ` BaseRouter.resolve_endpoint_params() ` and ` BaseRouter._serialize_response() ` internal methods
61+ - Multi-language documentation (single English version retained)
5362
5463
5564## [ 0.7.0] - 2025-04-27
0 commit comments