fix validation
See original GitHub issueGeneral information
- json-editor version: 2.0-dev
- I fixed a few other tests before (minor errors), but the validations for certain objects are not working correctly.
- Fixing this is a high priority to me, since validations are very important
https://travis-ci.org/json-editor/json-editor/jobs/571279410
Expected behavior
validation_test.js
should pass.
Actual behavior
It doesn’t.
Steps to reproduce the behavior
Run tests from develop/2.x-fix-tests
.
codeceptjs run editors/validation_test.js
The output with the failures:
required4 [test valid 0]: success
required4 [test invalid 0]: fail. Expected: errors, Actual: []
required4 [test invalid 1]: success
required4 [test invalid 2]: success
required4_merge [test valid 0]: success
required4_merge [test invalid 0]: fail. Expected: errors, Actual: []
required4_merge [test invalid 1]: fail. Expected: errors, Actual: []
The corresponding test data:
required4: {
schema: {
type: "object",
properties: {
required: {}
},
required: ["required"],
additionalProperties: true
},
valid: [
{required: true, test: 1}
],
invalid: [
{},
"a string",
[1,2,3]
]
},
required4_merge: {
schema: {
type: "object",
properties: {
orig: {},
other: {}
},
required: ["orig"],
oneOf: [
{
required: ["other"]
}
]
},
valid: [
{
orig: true,
other: true
}
],
invalid: [
{
orig: true
},
{
other: true
}
]
},
So an empty object {}
is now accepted, but it should trigger an error.
And oneOf
seems not to be correctly evaluated, since only an object with orig
AND other
should be valid.
CC: @pmk65 @wclssdn Can you shed some light and/or fix this?
Issue Analytics
- State:
- Created 4 years ago
- Comments:11
Top Results From Across the Web
Google reenables the validate fix feature in Search Console ...
Validate fix is back. Now when you go into Google Search Console and click on some of the coverage reports, the “validate fix”...
Read more >Message Validation : OnixS .NET FIX Engine
FIX Engine has the ability to validate any incoming messages and to reject that does not fit for the FIX protocol or its...
Read more >Fix Validation Errors - Pressbooks User Guide
Export validation error banner on the Exports screen. Each type of file is validated against different standards, so their validation logs will also...
Read more >How can I fix validation errors? - Customer Support - Gengo
Validating Jobs Before you can submit your translations, jobs are validated. This happens automatically, and there are two types of...
Read more >Correcting Data Validation Errors - IBM
This validation ensures all data adheres to the input schema requirements and is valid and usable. You must correct any errors the data...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@schmunk42 I found the culprit. It was the code I added for Button and Info editors in
src/validator.js
. I have pushed a fix to the develop/2.x branch.Yes, we can do that, but on the other hand we’re running this test always in the CI.