Comments (1)
I don't believe that this is a bug.
According to the draft v4 specification, the schema does not have to contain all of the elements declared by the "required" property. The object INSTANCE, on the other hand, must contain all "required" properties.
So, in the example above, the schema is valid according to draft v4. The object instance is invalid because it is missing one of the "required" properties, "bar".
Check for yourself using this json schema validator. The schema is accepted as valid, even with the superfluous "bar", while the object instance is rejected as invalid.
The above validator will tell you if the schema is invalid. In this case, it does not. Read section 5.4.3 and its subsections in the schema validation specification.
from json-schema.
Related Issues (20)
- Deprecation notice with PHP 8.1 HOT 2
- started getting error "nothing provides" HOT 5
- JsonSchema\Exception\ResourceNotFoundException
- Question about Dependency (json-schema/json-schema-test-suite) HOT 2
- Custom error messages HOT 6
- There is no ConstConstraint in released version. HOT 3
- Exception Error: "Maximum function nesting level of '256' reached, aborting!" HOT 1
- Show line numbers HOT 4
- Schema validation always returns true HOT 2
- Validation always returning true HOT 4
- oneOf, and anyOf annotation example HOT 4
- URI schemas incorrectly validated with FILTER_VALIDATE_URL HOT 7
- JsonSchema\Exception\InvalidArgumentException HOT 2
- JsonSchema\Exception\InvalidArgumentException | is an invalid type for string|null HOT 5
- HTTP to HTTPS redirection breaks remote reference resolution HOT 3
- not validating nested array with Symfony phpunit, or prop names HOT 3
- Possibly enum check is O(n) maybe can be O(1) for more performance HOT 4
- Why do we support higher version json-schema? HOT 3
- Inconsistent behavior with allOf/oneOf between master branch and latest release (v5.2.13) HOT 6
- Version number format changed in 5.2.13 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from json-schema.