Files
swagger-ui/src/core/plugins/oas31/json-schema-2020-12-extensions/fn.js

18 lines
341 B
JavaScript

/**
* @prettier
*/
export const makeIsExpandable = (original, { fn }) => {
if (typeof original !== "function") {
return null
}
const { hasKeyword } = fn.jsonSchema202012
return (schema) =>
original(schema) ||
hasKeyword(schema, "example") ||
schema?.xml ||
schema?.discriminator ||
schema?.externalDocs
}