Skip to content
Snippets Groups Projects
Commit a759cbd1 authored by Pavel Antonov's avatar Pavel Antonov :asterisk:
Browse files

Merge branch 'revert-66b02b9a' into 'master'

Revert "feat(core): Добавлена возможность использовать символ "-" в названиях полей"

See merge request perxis/perxis-go!235
parents 00570193 400d3a0b
No related branches found
No related tags found
No related merge requests found
......@@ -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)
}
}
}
......
......@@ -199,7 +199,7 @@ func TestFieldNameValidate(t *testing.T) {
{
"Contains hyphen",
"field-name",
false,
true,
},
{
"Contains underscore (success)",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment