UNPKG

@redocly/openapi-core

Version:

See https://github.com/Redocly/redocly-cli

21 lines 812 B
import { readFileAsStringSync } from '../../utils.js'; export const InfoDescriptionOverride = ({ filePath }) => { return { Info: { leave(info, { report, location }) { if (!filePath) throw new Error(`Parameter "filePath" is not provided for "info-description-override" rule`); try { info.description = readFileAsStringSync(filePath); } catch (e) { report({ message: `Failed to read markdown override file for "info.description".\n${e.message}`, location: location.child('description'), }); } }, }, }; }; //# sourceMappingURL=info-description-override.js.map