refactor: changed format "uriref" to "uri-ref", #367
parent
a063c61780
commit
cf3f1cea50
|
@ -39,7 +39,7 @@ Ajv.MissingRefError = errorClasses.MissingRef;
|
||||||
Ajv.$dataMetaSchema = $dataMetaSchema;
|
Ajv.$dataMetaSchema = $dataMetaSchema;
|
||||||
|
|
||||||
var META_SCHEMA_ID = 'http://json-schema.org/draft-06/schema';
|
var META_SCHEMA_ID = 'http://json-schema.org/draft-06/schema';
|
||||||
var SCHEMA_URI_FORMAT = formats.fast.uriref;
|
var SCHEMA_URI_FORMAT = formats.fast['uri-ref'];
|
||||||
|
|
||||||
function SCHEMA_URI_FORMAT_FUNC(str) {
|
function SCHEMA_URI_FORMAT_FUNC(str) {
|
||||||
return SCHEMA_URI_FORMAT.test(str);
|
return SCHEMA_URI_FORMAT.test(str);
|
||||||
|
|
|
@ -29,7 +29,7 @@ formats.fast = {
|
||||||
'date-time': /^\d\d\d\d-[0-1]\d-[0-3]\d[t\s][0-2]\d:[0-5]\d:[0-5]\d(?:\.\d+)?(?:z|[+-]\d\d:\d\d)$/i,
|
'date-time': /^\d\d\d\d-[0-1]\d-[0-3]\d[t\s][0-2]\d:[0-5]\d:[0-5]\d(?:\.\d+)?(?:z|[+-]\d\d:\d\d)$/i,
|
||||||
// uri: https://github.com/mafintosh/is-my-json-valid/blob/master/formats.js
|
// uri: https://github.com/mafintosh/is-my-json-valid/blob/master/formats.js
|
||||||
uri: /^(?:[a-z][a-z0-9+-.]*)?(?:\:|\/)\/?[^\s]*$/i,
|
uri: /^(?:[a-z][a-z0-9+-.]*)?(?:\:|\/)\/?[^\s]*$/i,
|
||||||
uriref: URIREF,
|
'uri-ref': URIREF,
|
||||||
// email (sources from jsen validator):
|
// email (sources from jsen validator):
|
||||||
// http://stackoverflow.com/questions/201323/using-a-regular-expression-to-validate-an-email-address#answer-8829363
|
// http://stackoverflow.com/questions/201323/using-a-regular-expression-to-validate-an-email-address#answer-8829363
|
||||||
// http://www.w3.org/TR/html5/forms.html#valid-e-mail-address (search for 'willful violation')
|
// http://www.w3.org/TR/html5/forms.html#valid-e-mail-address (search for 'willful violation')
|
||||||
|
@ -55,7 +55,7 @@ formats.full = {
|
||||||
time: time,
|
time: time,
|
||||||
'date-time': date_time,
|
'date-time': date_time,
|
||||||
uri: uri,
|
uri: uri,
|
||||||
uriref: URIREF,
|
'uri-ref': URIREF,
|
||||||
email: /^[a-z0-9!#$%&'*+\/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&''*+\/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,
|
email: /^[a-z0-9!#$%&'*+\/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&''*+\/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,
|
||||||
hostname: hostname,
|
hostname: hostname,
|
||||||
ipv4: /^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,
|
ipv4: /^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,
|
||||||
|
|
|
@ -39,7 +39,7 @@
|
||||||
"properties": {
|
"properties": {
|
||||||
"id": {
|
"id": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"format": "uriref"
|
"format": "uri-ref"
|
||||||
},
|
},
|
||||||
"$schema": {
|
"$schema": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
|
|
Loading…
Reference in New Issue