From 45ec759b6bb2bf99d1d757dd0c16486c71c68891 Mon Sep 17 00:00:00 2001 From: Thomas Leeds Date: Sat, 11 May 2024 17:37:54 +0100 Subject: [PATCH] fix: include dive tag --- validation_tags_to_schema.go | 2 ++ validation_tags_to_schema_test.go | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/validation_tags_to_schema.go b/validation_tags_to_schema.go index 778f140..8cccc8e 100644 --- a/validation_tags_to_schema.go +++ b/validation_tags_to_schema.go @@ -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 "dive": + continue case "required": fieldRequired = true diff --git a/validation_tags_to_schema_test.go b/validation_tags_to_schema_test.go index 21d5cbc..f020b12 100644 --- a/validation_tags_to_schema_test.go +++ b/validation_tags_to_schema_test.go @@ -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: "dive", + validateTag: "dive", + expectedSchema: allOfSchemas(), + }, { name: "required", validateTag: "required",