From 3584a2633fc324502c4c065584e294df1f6291b0 Mon Sep 17 00:00:00 2001 From: Vitaliy Kucheryaviy Date: Tue, 17 Sep 2024 11:49:18 +0300 Subject: [PATCH] pydatnic 2.9 compatibility --- ninja/openapi/schema.py | 2 ++ tests/test_with_django/test_multi_param_parsing.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/ninja/openapi/schema.py b/ninja/openapi/schema.py index 494e4e1d..65405948 100644 --- a/ninja/openapi/schema.py +++ b/ninja/openapi/schema.py @@ -341,6 +341,8 @@ def flatten_properties( # is_required = "default" not in prop_details yield prop_name, prop_details, prop_required else: + # pragma: no cover + # TODO: this code was for pydanitc 1.7+ ... <2.9 - check if this is still needed for item in prop_details["allOf"]: yield from flatten_properties("", item, True, definitions) diff --git a/tests/test_with_django/test_multi_param_parsing.py b/tests/test_with_django/test_multi_param_parsing.py index 4a59d7ee..c47eba1f 100644 --- a/tests/test_with_django/test_multi_param_parsing.py +++ b/tests/test_with_django/test_multi_param_parsing.py @@ -1,5 +1,5 @@ -import re import json +import re from pathlib import Path import pytest