common/json-schema : fix GBNF grammar generation for empty object schemas (#28279)

This commit is contained in:
Sergey Sklyarov
2026-09-03 15:37:50 -05:00
committed by GitHub
parent 95ef7fc160
commit c5a5535e6e
3 changed files with 8 additions and 1 deletions
+3
View File
@@ -734,6 +734,9 @@ class SchemaConverter:
)
optional_props.append("*")
if not required_props and not optional_props:
return '"{" space "}"'
rule = '"{" space '
rule += ' "," space '.join(prop_kv_rule_names[k] for k in required_props)