persona-community-5/.pnpm-store/v3/files/eb/a9a4672e8241cae8567a6cad6715c49fb1a6428db7aa5a8a4a016243e14199c2c9f8fe27b7082ee94d23d84fc9065cb9f33872f376c99b7990a421b3df1cd4
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

23 lines
583 B
Plaintext

import type { Oas3Rule } from '../../visitors';
export const NoEmptyServers: Oas3Rule = () => {
return {
Root(root, { report, location }) {
if (!root.hasOwnProperty('servers')) {
report({
message: 'Servers must be present.',
location: location.child(['openapi']).key(),
});
return;
}
if (!Array.isArray(root.servers) || root.servers.length === 0) {
report({
message: 'Servers must be a non-empty array.',
location: location.child(['servers']).key(),
});
}
},
};
};