UNPKG

@scalar/api-reference

Version:

Generate beautiful API references from OpenAPI documents

13 lines (12 loc) 338 B
const shouldDisplayDescription = (schema, propDescription) => { if (!schema) { return null; } if ("properties" in schema || "additionalProperties" in schema || "patternProperties" in schema || schema.allOf) { return null; } return propDescription || schema.description || null; }; export { shouldDisplayDescription };