Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
R
rjs_json_form
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boris Kocherov
rjs_json_form
Commits
704e691d
Commit
704e691d
authored
Aug 31, 2018
by
Boris Kocherov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tv4: add support exclusiveMinimum and exclusiveMaximum from draft7
parent
d74a7691
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
2 deletions
+8
-2
jsonform/tv4.js
jsonform/tv4.js
+8
-2
No files found.
jsonform/tv4.js
View file @
704e691d
...
@@ -814,18 +814,24 @@ ValidatorContext.prototype.validateMinMax = function validateMinMax(data, schema
...
@@ -814,18 +814,24 @@ ValidatorContext.prototype.validateMinMax = function validateMinMax(data, schema
if
(
data
<
schema
.
minimum
)
{
if
(
data
<
schema
.
minimum
)
{
return
this
.
createError
(
ErrorCodes
.
NUMBER_MINIMUM
,
{
value
:
data
,
minimum
:
schema
.
minimum
},
''
,
'
/minimum
'
,
null
,
data
,
schema
);
return
this
.
createError
(
ErrorCodes
.
NUMBER_MINIMUM
,
{
value
:
data
,
minimum
:
schema
.
minimum
},
''
,
'
/minimum
'
,
null
,
data
,
schema
);
}
}
if
(
schema
.
exclusiveMinimum
&&
data
===
schema
.
minimum
)
{
if
(
schema
.
exclusiveMinimum
===
true
&&
data
===
schema
.
minimum
)
{
return
this
.
createError
(
ErrorCodes
.
NUMBER_MINIMUM_EXCLUSIVE
,
{
value
:
data
,
minimum
:
schema
.
minimum
},
''
,
'
/exclusiveMinimum
'
,
null
,
data
,
schema
);
return
this
.
createError
(
ErrorCodes
.
NUMBER_MINIMUM_EXCLUSIVE
,
{
value
:
data
,
minimum
:
schema
.
minimum
},
''
,
'
/exclusiveMinimum
'
,
null
,
data
,
schema
);
}
}
}
}
if
((
typeof
schema
.
exclusiveMinimum
===
"
number
"
)
&&
data
<=
schema
.
exclusiveMinimum
)
{
return
this
.
createError
(
ErrorCodes
.
NUMBER_MINIMUM_EXCLUSIVE
,
{
value
:
data
,
minimum
:
schema
.
exclusiveMinimum
},
''
,
'
/exclusiveMinimum
'
,
null
,
data
,
schema
);
}
if
(
schema
.
maximum
!==
undefined
)
{
if
(
schema
.
maximum
!==
undefined
)
{
if
(
data
>
schema
.
maximum
)
{
if
(
data
>
schema
.
maximum
)
{
return
this
.
createError
(
ErrorCodes
.
NUMBER_MAXIMUM
,
{
value
:
data
,
maximum
:
schema
.
maximum
},
''
,
'
/maximum
'
,
null
,
data
,
schema
);
return
this
.
createError
(
ErrorCodes
.
NUMBER_MAXIMUM
,
{
value
:
data
,
maximum
:
schema
.
maximum
},
''
,
'
/maximum
'
,
null
,
data
,
schema
);
}
}
if
(
schema
.
exclusiveMaximum
&&
data
===
schema
.
maximum
)
{
if
(
schema
.
exclusiveMaximum
===
true
&&
data
===
schema
.
maximum
)
{
return
this
.
createError
(
ErrorCodes
.
NUMBER_MAXIMUM_EXCLUSIVE
,
{
value
:
data
,
maximum
:
schema
.
maximum
},
''
,
'
/exclusiveMaximum
'
,
null
,
data
,
schema
);
return
this
.
createError
(
ErrorCodes
.
NUMBER_MAXIMUM_EXCLUSIVE
,
{
value
:
data
,
maximum
:
schema
.
maximum
},
''
,
'
/exclusiveMaximum
'
,
null
,
data
,
schema
);
}
}
}
}
if
((
typeof
schema
.
exclusiveMaximum
===
"
number
"
)
&&
data
>=
schema
.
exclusiveMaximum
)
{
return
this
.
createError
(
ErrorCodes
.
NUMBER_MAXIMUM_EXCLUSIVE
,
{
value
:
data
,
maximum
:
schema
.
exclusiveMaximum
},
''
,
'
/exclusiveMaximum
'
,
null
,
data
,
schema
);
}
return
null
;
return
null
;
};
};
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment