persona-community-5/.pnpm-store/v3/files/e2/b376658cbeae5592fbd68e6322345870c3f6db208146f98f9596477a42fad8e99a16bb9e244871b68bd03c07c2babd40b2231c9ca0e940370a60eeb69732d1
rdev-worker a1d0d1bf1c
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
build: /implement-feature community-ui --requirements 'Build the React commu...
2026-02-24 08:22:30 +00:00

26 lines
805 B
Plaintext

import { readFileAsStringSync } from '../../utils';
import type { Oas3Decorator, Oas2Decorator } from '../../visitors';
import type { UserContext } from '../../walk';
export const InfoDescriptionOverride: Oas3Decorator | Oas2Decorator = ({ filePath }) => {
return {
Info: {
leave(info, { report, location }: UserContext) {
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'),
});
}
},
},
};
};