@redocly/openapi-core
Version:
See https://github.com/Redocly/redocly-cli
16 lines (14 loc) • 401 B
text/typescript
import { Oas3Rule, Oas2Rule } from '../../visitors';
import { missingRequiredField } from '../utils';
export const InfoContact: Oas3Rule | Oas2Rule = () => {
return {
Info(info, { report, location }) {
if (!info.contact) {
report({
message: missingRequiredField('Info', 'contact'),
location: location.child('contact').key(),
});
}
},
};
};