Skip to content

Commit

Permalink
PXP-10952 Fix allow_nulls() for oneOf/anyOf (#85)
Browse files Browse the repository at this point in the history
  • Loading branch information
paulineribeyre authored May 30, 2023
1 parent 5cb4228 commit 5ee2b6a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions dictionaryutils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ def allow_nulls(self):
if not isinstance(prop["enum"], list):
prop["enum"] = [prop["enum"]]
prop["enum"].append(None)
elif "anyOf" in prop:
elif "anyOf" in prop and {"type": "null"} not in prop["anyOf"]:
prop["anyOf"].append({"type": "null"})
elif "oneOf" in prop:
elif "oneOf" in prop and {"type": "null"} not in prop["oneOf"]:
prop["oneOf"].append({"type": "null"})
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "dictionaryutils"
version = "3.4.5"
version = "3.4.6"
description = "Python wrapper and metaschema for datadictionary."
authors = ["CTDS UChicago <[email protected]>"]
license = "Apache-2.0"
Expand Down

0 comments on commit 5ee2b6a

Please sign in to comment.