Skip to content

Commit 63e82c9

Browse files
committed
make tests pass
1 parent 17bda52 commit 63e82c9

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/normalize_json/normalize.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,14 +102,15 @@ def internal_flatten(obj: typing.Any, parent: str = '', depth: int = 0) -> typin
102102

103103

104104
def check_types(node: Node, value: typing.Any, modifiers: list[Modifier]):
105+
if node.get('array') and value == []:
106+
return None
107+
105108
actual = value[0].__class__.__name__ \
106109
if node.get('array') \
107110
else value.__class__.__name__
108111

109112
node_type = node.get('type', 'string')
110113

111-
if node.get('array') and value == []:
112-
return None
113114
if node_enum := node.get('enum'):
114115
if actual == 'NoneType' and 'default_null' in modifiers:
115116
return None

0 commit comments

Comments
 (0)