Releases: mr-fatalyst/fastopenapi
Releases · mr-fatalyst/fastopenapi
v1.0.0b1
Added
- Dependency Injection system with
DependsandSecurityfor automatic dependency resolution- Request-scoped caching (same dependency called multiple times returns cached result)
- Circular dependency detection
SecurityScopesinjection for OAuth2 scope validation- Generator/yield dependencies with proper cleanup (sync and async)
- FastAPI-style parameter classes:
Query,Path,Header,Cookie,Body,Form,File- Full Pydantic v2 validation:
gt,ge,lt,le,min_length,max_length,pattern,multiple_of,strict, etc. - Parameter metadata:
description,title,example,examples,deprecated - Alias support for headers and query parameters
- Full Pydantic v2 validation:
- Django support with
DjangoRouter(sync) andDjangoAsyncRouter(async), includingurlsproperty for Django URL patterns - Falcon async support with
FalconAsyncRouter(in addition to existing syncFalconRouter) FileUploadclass for framework-agnostic file handling with.read()and.aread()methods- Form data and file upload extraction for all frameworks
RequestDataunified container for request data across all frameworksResponseclass for custom responses with headers and status codes- Response model validation via
TypeAdapterwith thread-safe caching - Standardized error hierarchy:
APIError,BadRequestError,ValidationError(422),AuthenticationError,AuthorizationError,ResourceNotFoundError,ResourceConflictError,InternalServerError,ServiceUnavailableError,DependencyError,CircularDependencyError,SecurityError APIError.from_exception()for converting any exception to standardized JSON formatEXCEPTION_MAPPERon routers for framework-specific exception conversion (e.g., Django'sPermissionDenied→AuthorizationError)- Built-in OpenAPI security schemes: Bearer JWT, API Key (header/query), Basic Auth, OAuth2
- Custom security schemes via
security_schemeparameter (acceptsSecuritySchemeTypeenum or raw dict) - Security scheme merging in
include_router() SecuritySchemeTypeexported fromfastopenapifor public use- Documentation completely rewritten with guides, API reference, framework-specific pages, and examples
Changed
- Complete architecture refactor from monolithic
base_router.pyto composition-based modular design:core/—BaseRouter, parameter classes, dependency resolver, types, constantsresolution/—ParameterResolver(extracted fromBaseRouter.resolve_endpoint_params())response/—ResponseBuilder(extracted fromBaseRouter._serialize_response())openapi/—OpenAPIGenerator,SchemaBuilder, UI renderers (extracted fromBaseRouter.generate_openapi())errors/— error hierarchy (extracted fromerror_handler.py)routers/—BaseAdapter+ per-framework packages with separate extractors
- All framework routers now inherit from
BaseAdapterinstead ofBaseRouter - Each framework router split into separate router and extractor modules
- Route metadata stored in
RouteInfoclass (was tuple) - Validation errors now return HTTP 422 (was 400)
- OpenAPI
summaryresolved from route metadata or formatted endpoint name;descriptionfrom metadata or docstring - Improved import errors with
MissingRouterraisingImportErrorwhen framework is not installed djangoadded as optional dependency extra
Deprecated
- Importing from
fastopenapi.error_handlermodule (usefrom fastopenapi.errors import ...instead)
Removed
BaseRouter.generate_openapi()method (userouter.openapiproperty)BaseRouter.resolve_endpoint_params()andBaseRouter._serialize_response()internal methods- Multi-language documentation (single English version retained)
v0.7.0
Changed
- Replaced
json.dumps/json.loadswith pydantic_coreto_json/from_json _serialize_response: model list mapping now handled by Pydantic instead of manual recursion
Fixed
- Issue with parsing repeated query parameters in URL.
Removed
- The
use_aliasesfromBaseRouterand reverted changes from 0.6.0.
v0.6.0
Added
- The
use_aliasesparameter was added to theBaseRouterconstructor. Default isTrue. To preserve the previous behavior (without using aliases from Pydantic), setuse_aliases=False.
Changed
- The
_serialize_response methodis now an instance method (was a@staticmethod) — to supportuse_aliases. - The
_get_model_schemamethod was temporarily changed from a@classmethodto a regular method — for consistent behavior withuse_aliases.
Deprecated
use_aliasesis deprecated and will be removed in version 0.7.0.
v0.5.0
Added
AioHttpRouterfor integration with theAioHttpframework- Class-level cache for model schemas
response_errorsfor routerserror_handlerfor standard error responses- Some python types as response_model (
int,float,bool,str)
v0.4.0
Added
ReDoc UIand default URL (host:port/redoc)TornadoRouterfor integration with theTornadoframework
Changed
- Revised and updated all tests.
Fixed
- Status code for error response fixed: 422 -> 500
Removed
- Removed the
add_docs_routeandadd_openapi_routefromBaseRouter.
v0.3.1
Fixed
- router imports
ModuleNotFoundError
v0.3.0
Added
QuartRouterfor integration with theQuartframework.- Initial Documentation
Changed
- Import of routers. You can use
from fastopenapi.routers import YourRouter
Fixed
- Fixed retrieving parameters for BaseModel as arguments in GET routes.
v0.2.1
Fixed
- Fixed an issue in
_serialize_responsewhereBaseModelwas converted to a dictionary incorrectly. - Resolved a bug causing
DataLoaderto crash when processing empty datasets. - Added tests.
- Added
CHANGELOG.md.
v0.2.0
Added
- Implemented
resolve_endpoint_paramsinBaseRouter. - Added the
prefixparameter to theinclude_routermethod. - Implemented
status_codesupport for responses.
Changed
- Refactored all routers.
Removed
- Removed the
register_routesmethod fromStarlette.
v0.1.0
Added
- Initial release of FastOpenAPI.
- Implemented core modules:
base,falcon,flask,sanic,starlette. - Added basic documentation and tests.