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
07dd0ad7
Commit
07dd0ad7
authored
Aug 30, 2018
by
Boris Kocherov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tv4: add support boolean schema
parent
ce1f4e38
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
1 deletion
+6
-1
jsonform/tv4.js
jsonform/tv4.js
+6
-1
No files found.
jsonform/tv4.js
View file @
07dd0ad7
...
...
@@ -535,7 +535,7 @@ ValidatorContext.prototype.reset = function () {
ValidatorContext
.
prototype
.
validateAll
=
function
(
data
,
schema
,
dataPathParts
,
schemaPathParts
,
dataPointerPath
)
{
var
topLevel
;
if
(
!
schema
)
{
if
(
schema
===
undefined
||
schema
===
true
)
{
return
null
;
}
else
if
(
schema
instanceof
ValidationError
)
{
this
.
errors
.
push
(
schema
);
...
...
@@ -718,6 +718,9 @@ function recursiveCompare(A, B) {
}
ValidatorContext
.
prototype
.
validateBasic
=
function
validateBasic
(
data
,
schema
,
dataPointerPath
)
{
if
(
schema
===
false
&&
data
!==
undefined
)
{
return
this
.
createError
(
ErrorCodes
.
BOOLEAN_SCHEMA_FALSE
,
{},
''
,
''
,
null
,
data
,
schema
);
}
var
error
;
if
(
error
=
this
.
validateType
(
data
,
schema
,
dataPointerPath
))
{
return
error
.
prefixWith
(
null
,
"
type
"
);
...
...
@@ -1375,6 +1378,7 @@ var ErrorCodes = {
ONE_OF_MISSING
:
11
,
ONE_OF_MULTIPLE
:
12
,
NOT_PASSED
:
13
,
BOOLEAN_SCHEMA_FALSE
:
14
,
// Numeric errors
NUMBER_MULTIPLE_OF
:
100
,
NUMBER_MINIMUM
:
101
,
...
...
@@ -1416,6 +1420,7 @@ var ErrorMessagesDefault = {
ONE_OF_MISSING
:
"
Data does not match any schemas from
\"
oneOf
\"
"
,
ONE_OF_MULTIPLE
:
"
Data is valid against more than one schema from
\"
oneOf
\"
: indices {index1} and {index2}
"
,
NOT_PASSED
:
"
Data matches schema from
\"
not
\"
"
,
BOOLEAN_SCHEMA_FALSE
:
"
Schema does not allow any data
"
,
// Numeric errors
NUMBER_MULTIPLE_OF
:
"
Value {value} is not a multiple of {multipleOf}
"
,
NUMBER_MINIMUM
:
"
Value {value} is less than minimum {minimum}
"
,
...
...
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