We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
rec_strict_json_schema
1 parent be02ba7 commit 192f0a0Copy full SHA for 192f0a0
src/mistralai/extra/utils/_pydantic_helper.py
@@ -1,11 +1,12 @@
1
from typing import Any
2
3
+
4
def rec_strict_json_schema(schema_node: Any) -> Any:
5
"""
6
Recursively set the additionalProperties property to False for all objects in the JSON Schema.
7
This makes the JSON Schema strict (i.e. no additional properties are allowed).
8
- if isinstance(schema_node, (str, bool)):
9
+ if isinstance(schema_node, (str, bool)) or schema_node is None:
10
return schema_node
11
if isinstance(schema_node, dict):
12
if "type" in schema_node and schema_node["type"] == "object":
0 commit comments