Skip to content

Commit

Permalink
add back test for commas
Browse files Browse the repository at this point in the history
  • Loading branch information
conneroisu committed Sep 14, 2024
1 parent d68eb9e commit 09bcc0c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions schema_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ type CustomMapOuter struct {
}

type PatternTest struct {
WithPattern string `json:"with_pattern" jsonschema:"minLength=1,pattern=[0-9]{1\,4},maxLength=50"`
WithPattern string `json:"with_pattern" jsonschema:"minLength=1,pattern=[0-9]{1\\,4},maxLength=50"`
}

type RecursiveExample struct {
Expand Down Expand Up @@ -436,7 +436,7 @@ type Expression struct {

type PatternEqualsTest struct {
WithEquals string `jsonschema:"pattern=foo=bar"`
WithEqualsAndCommas string `jsonschema:"pattern=foo\,=bar"`
WithEqualsAndCommas string `jsonschema:"pattern=foo,=bar"`
}

func TestReflector(t *testing.T) {
Expand Down Expand Up @@ -642,6 +642,7 @@ func TestSchemaGeneration(t *testing.T) {
{ArrayType{}, &reflector{}, "testdata/array_type.json"},
{SchemaExtendTest{}, &reflector{}, "testdata/custom_type_extend.json"},
{Expression{}, &reflector{}, "testdata/schema_with_expression.json"},
{&PatternTest{}, &reflector{}, "testdata/commas_in_pattern.json"},
}

for _, tt := range tests {
Expand Down

0 comments on commit 09bcc0c

Please sign in to comment.