diff --git a/ninja/openapi/schema.py b/ninja/openapi/schema.py index 72226e77..7279142f 100644 --- a/ninja/openapi/schema.py +++ b/ninja/openapi/schema.py @@ -36,23 +36,21 @@ def __init__(self, api: "NinjaAPI", path_prefix: str) -> None: self.securitySchemes: DictStrAny = {} self.all_operation_ids: Set = set() extra_info = api.openapi_extra.get("info", {}) - super().__init__( - [ - ("openapi", "3.1.0"), - ( - "info", - { - "title": api.title, - "version": api.version, - "description": api.description, - **extra_info, - }, - ), - ("paths", self.get_paths()), - ("components", self.get_components()), - ("servers", api.servers), - ] - ) + super().__init__([ + ("openapi", "3.1.0"), + ( + "info", + { + "title": api.title, + "version": api.version, + "description": api.description, + **extra_info, + }, + ), + ("paths", self.get_paths()), + ("components", self.get_components()), + ("servers", api.servers), + ]) for k, v in api.openapi_extra.items(): if k not in self: self[k] = v @@ -237,12 +235,10 @@ def _create_multipart_schema_from_models( content_type = BODY_CONTENT_TYPES["file"] # get the various schemas - result = merge_schemas( - [ - self._create_schema_from_model(model, remove_level=False)[0] - for model in models - ] - ) + result = merge_schemas([ + self._create_schema_from_model(model, remove_level=False)[0] + for model in models + ]) result["title"] = "MultiPartBodyParams" return result, content_type diff --git a/ninja/schema.py b/ninja/schema.py index 056722af..f2f16341 100644 --- a/ninja/schema.py +++ b/ninja/schema.py @@ -97,6 +97,9 @@ def _convert_result(self, result: Any) -> Any: return result + def __repr__(self) -> str: + return f"" + class Resolver: __slots__ = ("_func", "_static", "_takes_context") diff --git a/ninja/testing/client.py b/ninja/testing/client.py index c0b81f1b..9c78bc2f 100644 --- a/ninja/testing/client.py +++ b/ninja/testing/client.py @@ -126,12 +126,10 @@ def _build_request( request.META = request_params.pop("META", {}) request.FILES = request_params.pop("FILES", {}) - request.META.update( - { - f"HTTP_{k.replace('-', '_')}": v - for k, v in request_params.pop("headers", {}).items() - } - ) + request.META.update({ + f"HTTP_{k.replace('-', '_')}": v + for k, v in request_params.pop("headers", {}).items() + }) request.headers = HttpHeaders(request.META) diff --git a/pyproject.toml b/pyproject.toml index 708fd58b..76b2d923 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -59,7 +59,7 @@ test = [ "pytest-asyncio", "psycopg2-binary", "mypy==1.7.1", - "ruff==0.1.6", + "ruff==0.1.7", "django-stubs", ] doc = ["mkdocs", "mkdocs-material", "markdown-include", "mkdocstrings"]