Skip to content

Commit

Permalink
fix: post process openapi schema to allow null types (#214)
Browse files Browse the repository at this point in the history
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
mjsqu and pre-commit-ci[bot] committed Sep 11, 2023
1 parent abc60b5 commit 00e29e7
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion tap_dbt/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,16 @@ def schema(self) -> dict[str, t.Any]:
Returns:
The schema for this stream.
"""
return self._resolve_openapi_ref()
openapi_response = self._resolve_openapi_ref()

for property_schema in openapi_response["properties"].values():
if property_schema.get("nullable"):
if isinstance(property_schema["type"], list):
property_schema["type"].append("null")
else:
property_schema["type"] = [property_schema["type"], "null"]

return openapi_response

@property
@abstractmethod
Expand Down

0 comments on commit 00e29e7

Please sign in to comment.