Validation with json schema for BEAR Resource
Install Webnium\BEAR\JsonSchmaValidation\ValidationModule in your AppModule.
Then this validator intercepts ResourceObject methods annotated with @Validate.
Validation process is below:
- Retrieve schema definition specifed via
$ro->links['describedBy']. - If schema does not have
linkproperty or has empty link property, do nothing. - Search an element of
linkproperty under constraint thatrelproperty is "self" andmethodproperty is called REST method(eg.GETwhen invocated method isonGet). - If found a link element, validate invocation arguments with
schemaproperty of it. - If not found, search a link element unser constraint that
relproperty is "self" and withoutmethodproperty. - If found that, validate invocation arguments with
schemaproperty of it. - If not found again, do nothing.
This library is destributed under BSD-3-Clause license. See LICENSE file for more infomation.
