Skip to content

Commit

Permalink
Fix comments
Browse files Browse the repository at this point in the history
  • Loading branch information
jaredoconnell committed Nov 14, 2024
1 parent 94462c2 commit 21b8caf
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion schema/enum_string_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ func TestStringEnumSerialization(t *testing.T) {

func TestStringEnumTypedSerialization(t *testing.T) {
// In this test a typed enum is being inputted into Serialize, but
// it is not using a typed
// it is not using a typed enum schema.
type Size string
s := schema.NewStringEnumSchema(map[string]*schema.DisplayValue{
"small": {NameValue: schema.PointerTo("Small")},
Expand Down
3 changes: 3 additions & 0 deletions schema/string.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ type String interface {
}

// NewStringSchema creates a new string schema.
// If the corresponding Golang type is not a string, but a type
// defined from a string (example `type NameOfType string`), use
// `NewTypedStringEnumSchema` instead.
func NewStringSchema(minLen *int64, maxLen *int64, pattern *regexp.Regexp) *StringSchema {
return &StringSchema{
MinValue: minLen,
Expand Down

0 comments on commit 21b8caf

Please sign in to comment.