Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion airbyte_cdk/utils/schema_inferrer.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ def _clean_any_of(self, node: InferredSchema) -> None:
node[_TYPE] = [node[_TYPE], _NULL_TYPE]
node.pop(_ANY_OF)
# populate `type` for `anyOf` if it's not present to pass all other checks
elif len(node[_ANY_OF]) == 2 and not self._null_type_in_any_of(node):
elif len(node[_ANY_OF]) > 1:
node[_TYPE] = [_NULL_TYPE]

def _clean_properties(self, node: InferredSchema) -> None:
Expand Down
2 changes: 2 additions & 0 deletions unit_tests/utils/test_schema_inferrer.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,7 @@
"nested_key_2": "United Kingdom",
},
},
{"title": "Nested_3", "type": "string", "value": "XL"},
],
}
},
Expand All @@ -247,6 +248,7 @@
"type": {"type": ["string", "null"]},
"value": {
"anyOf": [
{"type": "string"},
{"type": "array", "items": {"type": "string"}},
{
"type": "object",
Expand Down
Loading