File tree Expand file tree Collapse file tree 1 file changed +33
-0
lines changed 
tests/JsonSchema/Tests/Constraints Expand file tree Collapse file tree 1 file changed +33
-0
lines changed Original file line number Diff line number Diff line change @@ -38,6 +38,39 @@ public function testErrorPropertyIsPopulatedForRequiredIfMissingInInput()
3838        $ this assertErrorHasExpectedPropertyValue ($ error"foo " );
3939    }
4040
41+     public  function  testPathErrorPropertyIsPopulatedForRequiredIfMissingInInput ()
42+     {
43+         $ validatornew  UndefinedConstraint ();
44+         $ documentjson_decode (
45+             '{  
46+                 "foo": [{"baz": 1.5}] 
47+             } '
48+         );
49+         $ schemajson_decode (
50+             '{  
51+                 "type": "object", 
52+                 "properties": { 
53+                     "foo": { 
54+                         "type": "array", 
55+                         "items": { 
56+                             "type": "object", 
57+                             "properties": { 
58+                                 "bar": {"type": "number"}, 
59+                                 "baz": {"type": "number"} 
60+                             }, 
61+                             "required": ["bar"] 
62+                         } 
63+                     } 
64+                 }, 
65+                 "required": ["foo"] 
66+             } '
67+         );
68+ 
69+         $ validatorcheck ($ document$ schema
70+         $ error$ validatorgetErrors ();
71+         $ this assertErrorHasExpectedPropertyValue ($ error"foo[0].bar " );
72+     }
73+ 
4174    public  function  testErrorPropertyIsPopulatedForRequiredIfEmptyValueInInput ()
4275    {
4376        $ validatornew  UndefinedConstraint ();
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments