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

init

parents
/vendor/
{
"_readme": [
"This file locks the dependencies of your project to a known state",
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is @generated automatically"
],
"hash": "326dd0f14ee56e2f317987b03c879002",
"content-hash": "bf814b9c47b9d85162e4a9dade2434f6",
"packages": [
{
"name": "justinrainbow/json-schema",
"version": "5.2.7",
"source": {
"type": "git",
"url": "https://github.com/justinrainbow/json-schema.git",
"reference": "8560d4314577199ba51bf2032f02cd1315587c23"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/justinrainbow/json-schema/zipball/8560d4314577199ba51bf2032f02cd1315587c23",
"reference": "8560d4314577199ba51bf2032f02cd1315587c23",
"shasum": ""
},
"require": {
"php": ">=5.3.3"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^2.1",
"json-schema/json-schema-test-suite": "1.2.0",
"phpunit/phpunit": "^4.8.35"
},
"bin": [
"bin/validate-json"
],
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "5.0.x-dev"
}
},
"autoload": {
"psr-4": {
"JsonSchema\\": "src/JsonSchema/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Bruno Prieto Reis",
"email": "bruno.p.reis@gmail.com"
},
{
"name": "Justin Rainbow",
"email": "justin.rainbow@gmail.com"
},
{
"name": "Igor Wiedler",
"email": "igor@wiedler.ch"
},
{
"name": "Robert Schönthal",
"email": "seroscho@googlemail.com"
}
],
"description": "A library to validate a json schema.",
"homepage": "https://github.com/justinrainbow/json-schema",
"keywords": [
"json",
"schema"
],
"time": "2018-02-14 22:26:30"
}
],
"packages-dev": [],
"aliases": [],
"minimum-stability": "stable",
"stability-flags": [],
"prefer-stable": false,
"prefer-lowest": false,
"platform": [],
"platform-dev": []
}
<?php
include_once 'vendor/autoload.php';
$data = 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);
} else {
echo "JSON does not validate. Violations:\n";
foreach ($validator->getErrors() as $error) {
echo sprintf("[%s] %s\n", $error['property'], $error['message']);
}
}
{
"organization-name": "string",
"date-range": {
"start-datetime": "string",
"end-datetime": "string"
},
"contact-info": "string",
"report-id": "string",
"policies": [{
"policy": {
"policy-type": "string",
"policy-string": "string",
"policy-domain": "string",
"mx-host": "string"
},
"summary": {
"total-successful-session-count": "string",
"total-failure-session-count": "string"
},
"failure-details": [
{
"result-type": "string",
"sending-mta-ip": "string",
"receiving-mx-hostname": "string",
"receiving-mx-helo": "string",
"receiving-ip": "string",
"failed-session-count": "string",
"additional-information": "string",
"failure-reason-code": "string"
}
]
}
]
}
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