Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions validation_tags_to_schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,8 @@ func ValidationTagsToSchema(validationTag string) (tagSchema Schema, required bo
schema.Pattern = "^urn:[a-zA-Z0-9][a-zA-Z0-9-]{0,31}:([a-zA-Z0-9()+,\\-.:=@;$_!*'%/?#]|%[0-9a-fA-F]{2})+$"

// Primitives
case "":
continue
case "required":
fieldRequired = true

Expand Down
5 changes: 5 additions & 0 deletions validation_tags_to_schema_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -658,6 +658,11 @@ func TestValidateTagsToSchema(t *testing.T) {
validateTag: "urn_rfc2141",
expectedSchema: singleSchemaFromPattern("^urn:[a-zA-Z0-9][a-zA-Z0-9-]{0,31}:([a-zA-Z0-9()+,\\-.:=@;$_!*'%/?#]|%[0-9a-fA-F]{2})+$"),
},
{
name: "empty",
validateTag: "",
expectedSchema: Schema{},
},
{
name: "required",
validateTag: "required",
Expand Down