feat(oas31): add support for JSON Schema 2020-12 example keyword (#8652)

Refs #8513
This commit is contained in:
Vladimír Gorej
2023-05-11 13:26:21 +02:00
committed by GitHub
parent 091d6cbdad
commit 7d14577523
8 changed files with 134 additions and 34 deletions

View File

@@ -0,0 +1,12 @@
/**
* @prettier
*/
export const makeIsExpandable = (original, { fn }) => {
if (typeof original !== "function") {
return null
}
const { hasKeyword } = fn.jsonSchema202012
return (schema) => original(schema) || hasKeyword(schema, "example")
}