From 7afa6f02eb14cbe2f5003f2836c4f16761857355 Mon Sep 17 00:00:00 2001 From: Julian Berman Date: Fri, 5 Jun 2015 08:28:25 -0400 Subject: [PATCH] Squashed 'json/' changes from 0b657e8..3481a79 3481a79 Merge pull request #91 from gelraen/nonanchoredpattern 818553f Update pattern.json b63c96f Merge pull request #92 from gelraen/escapedref 2f043b0 Update ref.json 1ebe2b4 Add valid instances for escaped ref tests b117902 Add a test that checks for implicit anchoring d319afa Merge pull request #90 from bugventure/develop a2c9de2 Add jsen to the list of validators 6d4adfe Merge pull request #87 from legoktm/protocol-relative 824cb99 Add test case for protocol-relative uri validation git-subtree-dir: json git-subtree-split: 3481a793ab6a1042a5973549f735b18f2355fb4e --- README.md | 1 + tests/draft3/optional/format.json | 5 +++++ tests/draft3/pattern.json | 11 +++++++++++ tests/draft3/ref.json | 21 ++++++++++++++++++--- tests/draft4/optional/format.json | 5 +++++ tests/draft4/pattern.json | 11 +++++++++++ tests/draft4/ref.json | 21 ++++++++++++++++++--- 7 files changed, 69 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index aa63a6c..355defd 100644 --- a/README.md +++ b/README.md @@ -99,6 +99,7 @@ This suite is being used by: * [skeemas](https://github.com/Prestaul/skeemas) * [tv4](https://github.com/geraintluff/tv4) * [z-schema](https://github.com/zaggino/z-schema) +* [jsen](https://github.com/bugventure/jsen) ### .NET ### diff --git a/tests/draft3/optional/format.json b/tests/draft3/optional/format.json index fc86b03..3ca7319 100644 --- a/tests/draft3/optional/format.json +++ b/tests/draft3/optional/format.json @@ -77,6 +77,11 @@ "data": "http://foo.bar/?baz=qux#quux", "valid": true }, + { + "description": "a valid protocol-relative URI", + "data": "//foo.bar/?baz=qux#quux", + "valid": true + }, { "description": "an invalid URI", "data": "\\\\WINDOWS\\fileshare", diff --git a/tests/draft3/pattern.json b/tests/draft3/pattern.json index befc4b5..25e7299 100644 --- a/tests/draft3/pattern.json +++ b/tests/draft3/pattern.json @@ -19,5 +19,16 @@ "valid": true } ] + }, + { + "description": "pattern is not anchored", + "schema": {"pattern": "a+"}, + "tests": [ + { + "description": "matches a substring", + "data": "xxaayy", + "valid": true + } + ] } ] diff --git a/tests/draft3/ref.json b/tests/draft3/ref.json index c984019..903ecb6 100644 --- a/tests/draft3/ref.json +++ b/tests/draft3/ref.json @@ -86,19 +86,34 @@ }, "tests": [ { - "description": "slash", + "description": "slash invalid", "data": {"slash": "aoeu"}, "valid": false }, { - "description": "tilda", + "description": "tilda invalid", "data": {"tilda": "aoeu"}, "valid": false }, { - "description": "percent", + "description": "percent invalid", "data": {"percent": "aoeu"}, "valid": false + }, + { + "description": "slash valid", + "data": {"slash": 123}, + "valid": true + }, + { + "description": "tilda valid", + "data": {"tilda": 123}, + "valid": true + }, + { + "description": "percent valid", + "data": {"percent": 123}, + "valid": true } ] }, diff --git a/tests/draft4/optional/format.json b/tests/draft4/optional/format.json index 53c5d25..aacfd11 100644 --- a/tests/draft4/optional/format.json +++ b/tests/draft4/optional/format.json @@ -29,6 +29,11 @@ "data": "http://foo.bar/?baz=qux#quux", "valid": true }, + { + "description": "a valid protocol-relative URI", + "data": "//foo.bar/?baz=qux#quux", + "valid": true + }, { "description": "an invalid URI", "data": "\\\\WINDOWS\\fileshare", diff --git a/tests/draft4/pattern.json b/tests/draft4/pattern.json index befc4b5..25e7299 100644 --- a/tests/draft4/pattern.json +++ b/tests/draft4/pattern.json @@ -19,5 +19,16 @@ "valid": true } ] + }, + { + "description": "pattern is not anchored", + "schema": {"pattern": "a+"}, + "tests": [ + { + "description": "matches a substring", + "data": "xxaayy", + "valid": true + } + ] } ] diff --git a/tests/draft4/ref.json b/tests/draft4/ref.json index b38ff03..7e80552 100644 --- a/tests/draft4/ref.json +++ b/tests/draft4/ref.json @@ -86,19 +86,34 @@ }, "tests": [ { - "description": "slash", + "description": "slash invalid", "data": {"slash": "aoeu"}, "valid": false }, { - "description": "tilda", + "description": "tilda invalid", "data": {"tilda": "aoeu"}, "valid": false }, { - "description": "percent", + "description": "percent invalid", "data": {"percent": "aoeu"}, "valid": false + }, + { + "description": "slash valid", + "data": {"slash": 123}, + "valid": true + }, + { + "description": "tilda valid", + "data": {"tilda": 123}, + "valid": true + }, + { + "description": "percent valid", + "data": {"percent": 123}, + "valid": true } ] },