Skip to content

Commit

Permalink
make tests pass
Browse files Browse the repository at this point in the history
  • Loading branch information
minenwerfer committed Sep 10, 2024
1 parent 17bda52 commit 63e82c9
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/normalize_json/normalize.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,14 +102,15 @@ def internal_flatten(obj: typing.Any, parent: str = '', depth: int = 0) -> typin


def check_types(node: Node, value: typing.Any, modifiers: list[Modifier]):
if node.get('array') and value == []:
return None

actual = value[0].__class__.__name__ \
if node.get('array') \
else value.__class__.__name__

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

if node.get('array') and value == []:
return None
if node_enum := node.get('enum'):
if actual == 'NoneType' and 'default_null' in modifiers:
return None
Expand Down

0 comments on commit 63e82c9

Please sign in to comment.