From ffed4a5e17346cb4af08c7f108c1f7bbe1c85a1d Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Sat, 7 Mar 2026 23:24:46 -0700 Subject: [PATCH] fix(jsontypes): use {empty} instead of {any} for empty collections {any} implies we inspected values and found mixed types. {empty} is honest: we saw an empty array or object and have no type information. --- tools/jsontypes/rawpaths.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/jsontypes/rawpaths.go b/tools/jsontypes/rawpaths.go index ebb23d2..500e602 100644 --- a/tools/jsontypes/rawpaths.go +++ b/tools/jsontypes/rawpaths.go @@ -59,7 +59,7 @@ func (w *rawWalker) walk(prefix string, v any) { func (w *rawWalker) walkObject(prefix string, obj map[string]any) { if len(obj) == 0 { - w.emit(prefix + "{any}") + w.emit(prefix + "{empty}") return } @@ -110,7 +110,7 @@ func (w *rawWalker) walkStruct(prefix string, instances []map[string]any) { func (w *rawWalker) walkArray(prefix string, arr []any) { if len(arr) == 0 { - w.emit(prefix + "[]{any}") + w.emit(prefix + "[]{empty}") return } @@ -214,7 +214,7 @@ func (w *rawWalker) walkCollection(prefix string, values []any) { // If nothing was emitted (all nils, empty), emit any. if !hasNull && len(shapes) == 0 && len(nonObjects) == 0 { - w.emit(prefix + "{any}") + w.emit(prefix + "{empty}") } }