From 138bd21d83099ef0976926175e2557c0d6190405 Mon Sep 17 00:00:00 2001 From: M Date: Mon, 31 Aug 2026 22:10:45 +0200 Subject: [PATCH] Reject an empty field name MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A field named "" was reachable by exactly one spelling, a bare {} token, and by no dot path: List hid it and Fake could not ask for it. checkName rejects it now, for the reason it rejects a dot — a name no path can reach. That also makes the empty-segment rule unconditional. {a.} was rejected because a field really named "" would otherwise have made it resolve; no data can carry one, so the rule now guards a shape that cannot exist. Co-Authored-By: Claude Opus 5 --- node.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/node.go b/node.go index a0c4791..3074b43 100644 --- a/node.go +++ b/node.go @@ -266,6 +266,9 @@ var reservedList = strings.Join(strings.Split(reservedInName, ""), " ") // category or folder and a field go through it, so there is one answer to what a // name may contain. func checkName(name string) error { + if name == "" { + return fmt.Errorf("%q is empty, so no dot path can reach it", name) + } if i := strings.IndexAny(name, reservedInName); i >= 0 { return fmt.Errorf("%q contains %q; a name may not use %s, which the dot path and {token} grammars reserve", name, name[i:i+1], reservedList)