diff --git a/packages/rulesets/src/oas/__tests__/oas3_1-callbacks-in-webhook.test.ts b/packages/rulesets/src/oas/__tests__/oas3_1-callbacks-in-webhook.test.ts index 9ef389a8d..0706cdf6e 100644 --- a/packages/rulesets/src/oas/__tests__/oas3_1-callbacks-in-webhook.test.ts +++ b/packages/rulesets/src/oas/__tests__/oas3_1-callbacks-in-webhook.test.ts @@ -1,7 +1,7 @@ import { DiagnosticSeverity } from '@stoplight/types'; import testRule from '../../__tests__/__helpers__/tester'; -testRule('oas3_1-servers-in-webhook', [ +testRule('oas3_1-callbacks-in-webhook', [ { name: 'callbacks defined in webhook', document: { diff --git a/packages/rulesets/src/oas/index.ts b/packages/rulesets/src/oas/index.ts index 0d13b979f..16bef664b 100644 --- a/packages/rulesets/src/oas/index.ts +++ b/packages/rulesets/src/oas/index.ts @@ -711,24 +711,18 @@ const ruleset = { message: 'Servers should not be defined in a webhook.', formats: [oas3_1], recommended: true, - given: ['$.webhooks[*]'], + given: ['$.webhooks.servers'], then: { function: undefined, - functionOptions: { - properties: ['servers'], - }, }, }, 'oas3_1-callbacks-in-webhook': { message: 'Callbacks should not be defined in a webhook.', formats: [oas3_1], recommended: true, - given: ['$.webhooks[*][*]'], + given: ['$.webhooks[*][*].callbacks'], then: { function: undefined, - functionOptions: { - properties: ['callbacks'], - }, }, }, },