diff --git a/src/json_schema/mod.rs b/src/json_schema/mod.rs index e4d6f3b..1b586b6 100644 --- a/src/json_schema/mod.rs +++ b/src/json_schema/mod.rs @@ -918,6 +918,25 @@ mod tests { "username@example..com", // double dot in domain name "username@.example..com", // multiple errors in domain "username@123.123.123.12345", // invalid IP format + ] + ), + // ========================================================== + // URI Format + // ========================================================== + ( + r#"{"title": "Foo", "type": "string", "format": "uri"}"#, + URI, + vec![ + "http://example.com", + "https://example.com/path?query=param#fragment", + "ftp://ftp.example.com/resource", + "urn:isbn:0451450523", + ], + vec![ + "http:/example.com", // missing slash + "htp://example.com", // invalid scheme + "http://", // missing host + "example.com", // missing scheme ], ), ] {