APIDevTools / swagger-parser

Swagger 2.0 and OpenAPI 3.0 parser/validator
https://apitools.dev/swagger-parser
MIT License
1.08k stars 153 forks source link

Align schema validation with specification for objects #205

Closed feenst closed 2 years ago

feenst commented 2 years ago

Only an object should check for required properties based on the specification:

For each of these types, there are keywords that only apply to those types. For example, numeric types have a way of specifying a numeric range, that would not be applicable to other types.

See also comments in this issue.

philsturgeon commented 2 years ago

I'll be happy to merge this ASAP if you can accompany it with a test.

feenst commented 2 years ago

I'll be happy to merge this ASAP if you can accompany it with a test.

Test added

coveralls commented 2 years ago

Pull Request Test Coverage Report for Build 2320955039


Changes Missing Coverage Covered Lines Changed/Added Lines %
lib/validators/spec.js 3 4 75.0%
<!-- Total: 3 4 75.0% -->
Totals Coverage Status
Change from base Build 2320977531: 0%
Covered Lines: 265
Relevant Lines: 273

💛 - Coveralls
coveralls commented 2 years ago

Pull Request Test Coverage Report for Build 2320986666


Changes Missing Coverage Covered Lines Changed/Added Lines %
lib/validators/spec.js 3 4 75.0%
<!-- Total: 3 4 75.0% -->
Totals Coverage Status
Change from base Build 2320977531: -0.5%
Covered Lines: 265
Relevant Lines: 273

💛 - Coveralls