From 400d3a0b814364892f29920934955d62e1234bc8 Mon Sep 17 00:00:00 2001 From: Pavel Antonov <antonov@perx.ru> Date: Fri, 3 May 2024 09:07:40 +0000 Subject: [PATCH] =?UTF-8?q?Revert=20"feat(core):=20=D0=94=D0=BE=D0=B1?= =?UTF-8?q?=D0=B0=D0=B2=D0=BB=D0=B5=D0=BD=D0=B0=20=D0=B2=D0=BE=D0=B7=D0=BC?= =?UTF-8?q?=D0=BE=D0=B6=D0=BD=D0=BE=D1=81=D1=82=D1=8C=20=D0=B8=D1=81=D0=BF?= =?UTF-8?q?=D0=BE=D0=BB=D1=8C=D0=B7=D0=BE=D0=B2=D0=B0=D1=82=D1=8C=20=D1=81?= =?UTF-8?q?=D0=B8=D0=BC=D0=B2=D0=BE=D0=BB=20"-"=20=D0=B2=20=D0=BD=D0=B0?= =?UTF-8?q?=D0=B7=D0=B2=D0=B0=D0=BD=D0=B8=D1=8F=D1=85=20=D0=BF=D0=BE=D0=BB?= =?UTF-8?q?=D0=B5=D0=B9"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkg/schema/field/object.go | 4 ++-- pkg/schema/field/object_test.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/schema/field/object.go b/pkg/schema/field/object.go index 83d234cd..d86aa235 100644 --- a/pkg/schema/field/object.go +++ b/pkg/schema/field/object.go @@ -12,7 +12,7 @@ import ( ) var objectType = &ObjectType{} -var isValidName = regexp.MustCompile(`^[a-zA-Z][\w-]*$`).MatchString +var isValidName = regexp.MustCompile(`^[a-zA-Z][\w]*$`).MatchString type ObjectParameters struct { Inline bool `json:"inline"` @@ -219,7 +219,7 @@ func (ObjectType) ValidateParameters(p Parameters) error { for k := range params.Fields { if !isValidName(k) { return fmt.Errorf("field name '%s' must be in Latin, must not start with a number, "+ - "must not contain spaces - only characters '_' or '-' can be used", k) + "must not contain spaces - only characters '_' can be used", k) } } } diff --git a/pkg/schema/field/object_test.go b/pkg/schema/field/object_test.go index 0dc179a7..2ada594b 100644 --- a/pkg/schema/field/object_test.go +++ b/pkg/schema/field/object_test.go @@ -199,7 +199,7 @@ func TestFieldNameValidate(t *testing.T) { { "Contains hyphen", "field-name", - false, + true, }, { "Contains underscore (success)", -- GitLab