fix: error with invalid type when using exclusiveMininimum and exclusiveMaximum in OpenApi 3.0#2384
fix: error with invalid type when using exclusiveMininimum and exclusiveMaximum in OpenApi 3.0#2384AlbinaBlazhko17 wants to merge 15 commits intomainfrom
Conversation
…iveMaximum in oas3
🦋 Changeset detectedLatest commit: 7dfdffa The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
package.json
Outdated
| ] | ||
| }, | ||
| "dependencies": { | ||
| "ajv-formats": "^3.0.1" |
There was a problem hiding this comment.
Why do we need it in the root dependencies?
There was a problem hiding this comment.
Thanks for the observation, i removed it, but i think, we need to upgrade ajv-formats package to 3.0.1 in core, because old version causes errors.
| ): { valid: boolean; errors: (ErrorObject & { suggest?: string[] })[] } { | ||
| const validate = getAjvValidator(schema, schemaLoc, resolve, allowAdditionalProperties); | ||
| const validate = | ||
| specVersion === 'oas3_0' || specVersion === 'oas2' |
There was a problem hiding this comment.
Coud you add a comment with the link to a document which clarifies the JSON Schema drafts usage for these OAS versions?
There was a problem hiding this comment.
Draft-04 handles only validation of exclusiveMinimum and exclusiveMaximum for boolean, and all other validations it handles using types/functions/library/vocabulary from basic AJV.
|
Could you check if we need to adjust types in the |
What/Why/How?
The ajv validator, which we are using to validate JSON Schemas didn't supports
exclusiveMininimumandexclusiveMaximumproperties as boolean type. That's why i need to use olddraft-04version to have a proper validation for these properties. Also, this olddraft-04version supports only old refs with uri, that's why we need to create own fork and publish own package to npm called@redocly/ajv-draft-04.Reference
Resolves #1610
Testing
Ran tests new and created.
Screenshots (optional)
Check yourself
Security