Skip to content

re-enable keywords now properly supported#1031

Merged
cdimascio merged 1 commit intocdimascio:masterfrom
uwinkelvos:master
Dec 27, 2024
Merged

re-enable keywords now properly supported#1031
cdimascio merged 1 commit intocdimascio:masterfrom
uwinkelvos:master

Conversation

@uwinkelvos
Copy link
Copy Markdown
Contributor

With #882 merged, some keywords that where previously not relevant are should now be checked by ajv.

for (let [formatName, formatDefinition] of Object.entries(options.formats)) {
ajv.addFormat(formatName, formatDefinition);
}
ajv.removeKeyword('propertyNames');
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

won't these still be necessary for clients using openapi 3.0.x?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When I try to load an openapi 3.0.x spec, that uses e.g. const, I get a validation at middleware construction time. And even if this was bypassed somehow, Ajv would understand the keywords. So imho there is no harm at allowing them at this level (Ajv).

@cdimascio cdimascio merged commit 83dac8a into cdimascio:master Dec 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants