From e155e0bbf48d367ce63fd8ceaf62c275eb73bb5f Mon Sep 17 00:00:00 2001 From: Weaselbot Date: Wed, 24 Jun 2026 09:51:19 -0400 Subject: [PATCH] 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, breaking the nullable root tests. Return the (TObj, nullable) tuple so callers (including the root emitter) see the correct nullability again. --- contrib/schemagen/weaseljson_schemagen.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/schemagen/weaseljson_schemagen.py b/contrib/schemagen/weaseljson_schemagen.py index be75e72..8c8b72b 100644 --- a/contrib/schemagen/weaseljson_schemagen.py +++ b/contrib/schemagen/weaseljson_schemagen.py @@ -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):