File tree Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -60,6 +60,34 @@ def test_even_level_fragment_resolution
6060 refute_valid schema , { } , :fragment => "#/foo/bar"
6161 end
6262
63+ def test_fragment_resolution_with_array
64+ document = {
65+ "definitions" => {
66+ "schemas" => [
67+ {
68+ "type" => "object" ,
69+ "required" => [ "a" ] ,
70+ "properties" => {
71+ "a" => {
72+ "type" => "object" ,
73+ }
74+ }
75+ } ,
76+ {
77+ "type" => "object" ,
78+ "properties" => {
79+ "b" => { "type" => "integer" }
80+ }
81+ }
82+ ]
83+ }
84+ }
85+
86+ data = { "b" => 5 }
87+ refute_valid document , data , :fragment => "#/definitions/schemas/0"
88+ assert_valid document , data , :fragment => "#/definitions/schemas/1"
89+ end
90+
6391 def test_array_fragment_resolution
6492 schema = {
6593 "type" => "object" ,
You can’t perform that action at this time.
0 commit comments