Mise à jour
Mise à jour de la base de données, veuillez patienter...
Site original : Tontof
"0": "00000100"
"1": "10000100",
"01": "01000011",
"010": "01000010",
"0110": "01100001",
"01110": "01110000",
"011110": "0111100000000111",
"0111110": "0111110000000110",
"01111110": "0111111000000101",
"011111110": "0111111100000100"
"0": "00000100"
"1": "10000100",
"01": "01000011",
"010": "01000010",
"0110": "01100001",
"01110": "01110000",
"011110": "0111100000000111",
"0111110": "0111110000000110",
"01111110": "0111111000000101",
"011111110": "0111111100000100"
tests suite: nb tests nb files
draft3: 520/520 35/35
draft4: 735/735 38/38
draft6: 995/995 48/48
draft7: 1286/1286 57/57
draft2019-09: 1571/1651 59/68
draft2020-12: 1579/1677 58/68
draft-next: 1623/1724 58/68
<?php
include_once(__DIR__ . '/schema/json.php');
$json = 'https://json-schema.org/learn/examples/address.schema.json';
$address = file_get_contents($json);
$data = '
{
"locality":"locality",
"region":"region"
}
';
var_dump(json_schema(json_decode($address), json_decode($data)));
$data = '
{
"locality":"locality",
"region":"region",
"country-name":"country-name"
}
';
var_dump(json_schema(json_decode($address), json_decode($data)));
$data = '
{
"locality":"locality",
"region":"region",
"country-name":"country-name",
"post-office-box":"post-office-box"
}
';
var_dump(json_schema(json_decode($address), json_decode($data)));
$data = '
{
"locality":"locality",
"region":"region",
"country-name":"country-name",
"post-office-box":"post-office-box",
"street-address":"street-address"
}
';
var_dump(json_schema(json_decode($address), json_decode($data)));
?>
Ce qui donne comme attendu :
bool(false)
bool(true)
bool(false)
bool(true)
tests suite: nb tests nb files
draft3: 520/520 35/35
draft4: 735/735 38/38
draft6: 995/995 48/48
draft7: 1286/1286 57/57
draft2019-09: 1571/1651 59/68
draft2020-12: 1579/1677 58/68
draft-next: 1623/1724 58/68
<?php
include_once(__DIR__ . '/schema/json.php');
$json = 'https://json-schema.org/learn/examples/address.schema.json';
$address = file_get_contents($json);
$data = '
{
"locality":"locality",
"region":"region"
}
';
var_dump(json_schema(json_decode($address), json_decode($data)));
$data = '
{
"locality":"locality",
"region":"region",
"country-name":"country-name"
}
';
var_dump(json_schema(json_decode($address), json_decode($data)));
$data = '
{
"locality":"locality",
"region":"region",
"country-name":"country-name",
"post-office-box":"post-office-box"
}
';
var_dump(json_schema(json_decode($address), json_decode($data)));
$data = '
{
"locality":"locality",
"region":"region",
"country-name":"country-name",
"post-office-box":"post-office-box",
"street-address":"street-address"
}
';
var_dump(json_schema(json_decode($address), json_decode($data)));
?>
Ce qui donne comme attendu :
bool(false)
bool(true)
bool(false)
bool(true)