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

complete schema

parent 10609dae
...@@ -2,15 +2,14 @@ ...@@ -2,15 +2,14 @@
include_once 'vendor/autoload.php'; include_once 'vendor/autoload.php';
$data = file_get_contents('php://input'); $data = json_decode(file_get_contents('php://input'));
$validator = new JsonSchema\Validator; $validator = new JsonSchema\Validator;
$validator->validate($data, (object)['$ref' => 'file://' . realpath('schema.json')]); $validator->validate($data, (object)['$ref' => 'file://' . realpath('schema.json')]);
if ($validator->isValid()) { if ($validator->isValid()) {
$report = json_decode($data);
// TODO... // TODO...
//var_dump($report); //var_dump($data);
} else { } else {
echo "JSON does not validate. Violations:\n"; echo "JSON does not validate. Violations:\n";
foreach ($validator->getErrors() as $error) { foreach ($validator->getErrors() as $error) {
......
...@@ -6,7 +6,10 @@ ...@@ -6,7 +6,10 @@
"title": "The MTA-STS Schema", "title": "The MTA-STS Schema",
"required": [ "required": [
"organization-name", "organization-name",
"contact-info" "date-range",
"contact-info",
"report-id",
"policies"
], ],
"properties": { "properties": {
"organization-name": { "organization-name": {
......
Supports Markdown
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