schemagen: restore nullable tuple return for object schemas

The previous change to cache object definitions started returning the
bare TObj from build_type for object schemas, discarding the nullable
flag. This caused nullable root objects to be emitted as plain structs
instead of std::optional<RootInner>, breaking the nullable root tests.

Return the (TObj, nullable) tuple so callers (including the root
emitter) see the correct nullability again.
This commit is contained in:
2026-06-24 09:51:19 -04:00
parent 717f30099f
commit e155e0bbf4
+1 -1
View File
@@ -306,7 +306,7 @@ class Builder:
return result
if typ == "object" or (typ is None and "properties" in node):
return self._build_object(node, hint, defname, nullable)
return (self._build_object(node, hint, defname, nullable), nullable)
if typ == "array":
if "items" not in node or not isinstance(node["items"], dict):