abacaphiliac/zend-json-schema-validator
最新稳定版本:1.0.0
Composer 安装命令:
composer require abacaphiliac/zend-json-schema-validator
包简介
A ZF2 validator for justinrainbow/json-schema.
README 文档
README
abacaphiliac/zend-json-schema-validator
A ZF2 validator for justinrainbow/json-schema.
Installation
composer require abacaphiliac/zend-json-schema-validator
Usage
Use it inline:
$validator = new \Abacaphiliac\Zend\Validator\JsonSchema(array(
'file' => '/path/to/your/schema.json',
));
if (!$validator->isValid('{"Foo":"Bar"}')) {
$validationMessages = $validator->getMessages();
}
Hook it up to an Apigility input-filter-spec:
return array(
'input_filter_specs' => array(
'YourApi\\V1\\Rest\\YourService\\Validator' => array(
array(
'name' => 'YourJsonParam',
'validators' => array(
array(
'name' => 'IntegrationConfiguration\\Validator\\JsonSchema',
'options' => array(
'file' => dirname(dirname(dirname(__DIR__))) . '/config/json-schema/IntegrationConfiguration/V1/Rest/OutboundDocumentation/configurations-config.json',
),
),
)
),
),
),
);
Dependencies
See composer.json.
Contributing
composer update && vendor/bin/phing
This library attempts to comply with PSR-1, PSR-2, and PSR-4. If you notice compliance oversights, please send a patch via pull request.
统计信息
- 总下载量: 69.4k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2016-06-09