public function validateTypes($value, $schema = null, $path = null, $i = null) { // check array if (is_array($value) || $value instanceof \ArrayAccess) { $this->checkArray($value, $schema, $path, $i); } parent::validateTypes($value, $schema = null, $path = null, $i = null); }
public function testErrorPropertyIsPopulatedForRequiredIfEmptyValueInInput() { $validator = new UndefinedConstraint(); $document = json_decode('{ "bar": 42, "foo": null }'); $schema = json_decode('{ "type": "object", "properties": { "foo": {"type": "number"}, "bar": {"type": "number"} }, "required": ["foo"] }'); $validator->check($document, $schema); $error = $validator->getErrors(); $this->assertErrorHasExpectedPropertyValue($error, "foo"); }
/** * Checks a undefined element * * @param mixed $value * @param mixed $schema * @param mixed $path * @param mixed $i */ protected function checkUndefined($value, $schema = null, $path = null, $i = null) { $validator = new UndefinedConstraint($this->checkMode, $this->uriRetriever, $this->uriResolver, $this->schemaId); $validator->check($value, $schema, $path, $i); $this->addErrors($validator->getErrors()); }