Skip to content

Commit

Permalink
fix: correct schema for optional type (#4459)
Browse files Browse the repository at this point in the history
Signed-off-by: Frost Ming <[email protected]>
  • Loading branch information
frostming authored Jan 31, 2024
1 parent c02b4ca commit 3371eb1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/_bentoml_sdk/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ def _flatten_field(

def _flatten_model_schema(model: type[IODescriptor]) -> dict[str, t.Any]:
schema = model.model_json_schema()
if not schema.get("properties") or "$defs" not in schema:
if not schema.get("properties"):
return schema
defs = schema.pop("$defs", {})
return _flatten_field(schema, defs)
Expand Down

0 comments on commit 3371eb1

Please sign in to comment.