Commit ae252201 authored by Bastien Durel's avatar Bastien Durel
Browse files

complete schema

parent 10609dae
......@@ -2,15 +2,14 @@
include_once 'vendor/autoload.php';
$data = file_get_contents('php://input');
$data = json_decode(file_get_contents('php://input'));
$validator = new JsonSchema\Validator;
$validator->validate($data, (object)['$ref' => 'file://' . realpath('schema.json')]);
if ($validator->isValid()) {
$report = json_decode($data);
// TODO...
//var_dump($report);
//var_dump($data);
} else {
echo "JSON does not validate. Violations:\n";
foreach ($validator->getErrors() as $error) {
......
......@@ -6,7 +6,10 @@
"title": "The MTA-STS Schema",
"required": [
"organization-name",
"contact-info"
"date-range",
"contact-info",
"report-id",
"policies"
],
"properties": {
"organization-name": {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment