fix(jambo): skip Annotated wrapping for trivial anyOf field constraints (#3)

This commit is contained in:
Thomas
2025-07-04 11:56:29 +02:00
committed by GitHub
parent 7c1278af16
commit 0c4de62bba
2 changed files with 31 additions and 11 deletions

View File

@@ -46,11 +46,8 @@ class TestAnyOfTypeParser(TestCase):
type_1, type_2 = get_args(type_parsing)
self.assertEqual(get_origin(type_1), Annotated)
self.assertIn(str, get_args(type_1))
self.assertEqual(get_origin(type_2), Annotated)
self.assertIn(int, get_args(type_2))
self.assertEqual(type_1, str)
self.assertEqual(type_2, int)
def test_any_of_string_or_int_with_default(self):
"""
@@ -74,11 +71,8 @@ class TestAnyOfTypeParser(TestCase):
type_1, type_2 = get_args(type_parsing)
self.assertEqual(get_origin(type_1), Annotated)
self.assertIn(str, get_args(type_1))
self.assertEqual(get_origin(type_2), Annotated)
self.assertIn(int, get_args(type_2))
self.assertEqual(type_1, str)
self.assertEqual(type_2, int)
self.assertEqual(type_validator["default"], 42)