Removes OneOf due to complexity and niche use case

After further analysis, the functionality was deemed too complex to implement for such a niche use case and will therefore be removed from the implementation backlog
This commit is contained in:
2025-04-17 16:06:55 -03:00
parent dc350aaa8b
commit 5fdb4fa724
4 changed files with 54 additions and 2 deletions

View File

@@ -0,0 +1,25 @@
from jambo.parser.anyof_type_parser import AnyOfTypeParser
from typing import Union, get_args, get_origin
from unittest import TestCase
class TestAnyOfTypeParser(TestCase):
def test_any_of_string_or_int(self):
"""
Tests the AnyOfTypeParser with a string or int type.
"""
properties = {
"anyOf": [
{"type": "string"},
{"type": "integer"},
],
}
type_parsing, _ = AnyOfTypeParser.from_properties("placeholder", properties)
# check union type has string and int
self.assertEqual(get_origin(type_parsing), Union)
self.assertIn(str, get_args(type_parsing))
self.assertIn(int, get_args(type_parsing))