Skip to content

Commit

Permalink
fix: remove JSON customization for anyOf elements
Browse files Browse the repository at this point in the history
This eliminate error in validating an `anyOf` element containing
a `string` element for example
  • Loading branch information
candleindark committed Nov 5, 2024
1 parent b2205ac commit 5111e31
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions dandischema/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -563,7 +563,6 @@ def __get_pydantic_json_schema__(
if value.get("format", None) == "uri":
value["maxLength"] = 1000
allOf = value.get("allOf")
anyOf = value.get("anyOf")
items = value.get("items")
if allOf is not None:
if len(allOf) == 1 and "$ref" in allOf[0]:
Expand All @@ -573,9 +572,6 @@ def __get_pydantic_json_schema__(
value["oneOf"] = value["allOf"]
value["type"] = "object"
del value["allOf"]
if anyOf is not None:
if len(anyOf) > 1 and any(["$ref" in val for val in anyOf]):
value["type"] = "object"
if items is not None:
anyOf = items.get("anyOf")
if (
Expand Down

0 comments on commit 5111e31

Please sign in to comment.