forked from weaselab/weaseljson
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:
@@ -306,7 +306,7 @@ class Builder:
|
|||||||
return result
|
return result
|
||||||
|
|
||||||
if typ == "object" or (typ is None and "properties" in node):
|
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 typ == "array":
|
||||||
if "items" not in node or not isinstance(node["items"], dict):
|
if "items" not in node or not isinstance(node["items"], dict):
|
||||||
|
|||||||
Reference in New Issue
Block a user