From 393cbc4d72fc647e211d2cef7a749f7e46928781 Mon Sep 17 00:00:00 2001 From: Emanuele Addis Date: Thu, 4 Aug 2022 17:17:40 +0200 Subject: [PATCH] [ADD] Support new APIRoute Fields --- fastapi_responseschema/__init__.py | 2 +- fastapi_responseschema/routing.py | 6 ++++-- pyproject.toml | 2 +- tests/test_fastapi_responseschema.py | 2 +- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/fastapi_responseschema/__init__.py b/fastapi_responseschema/__init__.py index 0ee2be7..ae1def7 100644 --- a/fastapi_responseschema/__init__.py +++ b/fastapi_responseschema/__init__.py @@ -3,7 +3,7 @@ from .helpers import wrap_app_responses, wrap_error_responses -__version__ = '1.1.0' +__version__ = '1.2.0' __all__ = [ diff --git a/fastapi_responseschema/routing.py b/fastapi_responseschema/routing.py index e489008..a01f717 100644 --- a/fastapi_responseschema/routing.py +++ b/fastapi_responseschema/routing.py @@ -148,7 +148,8 @@ def __init__( include_in_schema: bool = True, response_class: Optional[Type[Response]] = None, dependency_overrides_provider: Optional[Any] = None, - callbacks: Optional[List["APIRoute"]] = None + callbacks: Optional[List["APIRoute"]] = None, + **kwargs: Any ) -> None: if response_model: # If a `response_model` is set, then wrap the `response_model` with a response schema WrapperModel = self.get_wrapper_model(is_error=self.is_error_state(status_code=status_code), response_model=response_model) @@ -200,7 +201,8 @@ def __init__( include_in_schema=include_in_schema, response_class=response_class, dependency_overrides_provider=dependency_overrides_provider, - callbacks=callbacks + callbacks=callbacks, + **kwargs ) diff --git a/pyproject.toml b/pyproject.toml index 359679b..271a037 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "fastapi-responseschema" -version = "1.1.0" +version = "1.2.0" description = "Generic and common response schemas for FastAPI" authors = ["Emanuele Addis "] license = "MIT" diff --git a/tests/test_fastapi_responseschema.py b/tests/test_fastapi_responseschema.py index 743b24b..35c0e66 100644 --- a/tests/test_fastapi_responseschema.py +++ b/tests/test_fastapi_responseschema.py @@ -2,4 +2,4 @@ def test_version(): - assert __version__ == '1.1.0' + assert __version__ == '1.2.0'