Skip to content

Commit

Permalink
Allow all-lowercase as a strict name (#43)
Browse files Browse the repository at this point in the history
  • Loading branch information
DQSevilla authored May 24, 2023
1 parent e8fc79d commit 74c43ef
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion member_names.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ func init() {
// - at least one lower case letter
// - camel case, and must end with a lower case letter
// - may have digits inside the word
strictNameRegex = regexp.MustCompile(`^([a-z]|[a-z]+((\d)|([A-Z\d][a-z\d]+))*([A-Z\d][a-z\d]*[a-z]))$`)
strictNameRegex = regexp.MustCompile(`^[a-z]+(|(\d|([A-Z\d][a-z\d]+))*([A-Z\d][a-z\d]*[a-z]))$`)
}

// MemberNameValidationMode controls how document member names are checked for correctness.
Expand Down
1 change: 1 addition & 0 deletions member_names_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ func TestIsValidMemberName(t *testing.T) {
testValidations := map[MemberNameValidationMode][]string{
StrictValidation: {
"a",
"lowercase",
"lowercase1with2numerals",
"camelCase",
"camel12Case9WithNumera1s",
Expand Down

0 comments on commit 74c43ef

Please sign in to comment.