From c639b10f9a5b58c992967e5ce14256c28ee37eaa Mon Sep 17 00:00:00 2001 From: fiatjaf Date: Sun, 31 May 2026 00:07:49 -0300 Subject: [PATCH] schema: empty string is ok for non-required tag items. --- schema/schema.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/schema/schema.go b/schema/schema.go index 313bc5f..3172f35 100644 --- a/schema/schema.go +++ b/schema/schema.go @@ -385,7 +385,9 @@ func (v *Validator) validateNext(tag nostr.Tag, index int, this *ContentSpec) (f return index, ErrDanglingSpace } - if validator, ok := v.TypeValidators[this.Type]; ok { + if tag[index] == "" && !this.Required { + // empty string ok for non-required items + } else if validator, ok := v.TypeValidators[this.Type]; ok { if err := validator(tag[index], this); err != nil { return index, fmt.Errorf("invalid %s value '%s' at tag '%s', index %d: %w", this.Type, tag[index], tag[0], index, err)