Skip to content

Commit

Permalink
fix: Null type is now correctly appended as {"type": "null"} to `on…
Browse files Browse the repository at this point in the history
…eOf` types (#2252)
  • Loading branch information
edgarrmondragon committed Mar 6, 2024
1 parent f4529cb commit 2151377
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion singer_sdk/helpers/_typing.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def append_type(type_dict: dict, new_type: str) -> dict:
return result

if "oneOf" in result:
result["oneOf"].append(new_type)
result["oneOf"].append({"type": new_type})
return result

if "type" in result:
Expand Down
2 changes: 1 addition & 1 deletion tests/core/test_typing.py
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ def test_to_sql_type(jsonschema_type, expected):
),
pytest.param(
{"oneOf": [{"type": "integer"}, {"type": "number"}]},
{"oneOf": [{"type": "integer"}, {"type": "number"}, "null"]},
{"oneOf": [{"type": "integer"}, {"type": "number"}, {"type": "null"}]},
id="oneOf",
),
],
Expand Down

0 comments on commit 2151377

Please sign in to comment.