@redocly/openapi-core
Version:
See https://github.com/Redocly/redocly-cli
17 lines (14 loc) • 387 B
text/typescript
import { missingRequiredField } from '../utils';
import type { Oas3Rule, Oas2Rule } from '../../visitors';
export const InfoLicense: Oas3Rule | Oas2Rule = () => {
return {
Info(info, { report }) {
if (!info.license) {
report({
message: missingRequiredField('Info', 'license'),
location: { reportOnKey: true },
});
}
},
};
};