From adab6764d32af663f5e79663b5e29e02000a433b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maciej=20Urba=C5=84czyk?= Date: Thu, 19 May 2022 12:43:56 +0200 Subject: [PATCH] Apply suggestions from code review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Jakub Rożek --- .../functions/asyncApi2ChannelParameters.ts | 10 +++++++++- .../asyncapi/functions/asyncApi2ServerVariables.ts | 13 ++++++++++++- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/packages/rulesets/src/asyncapi/functions/asyncApi2ChannelParameters.ts b/packages/rulesets/src/asyncapi/functions/asyncApi2ChannelParameters.ts index 24897fc64..4302b33a3 100644 --- a/packages/rulesets/src/asyncapi/functions/asyncApi2ChannelParameters.ts +++ b/packages/rulesets/src/asyncapi/functions/asyncApi2ChannelParameters.ts @@ -8,7 +8,15 @@ import type { IFunctionResult } from '@stoplight/spectral-core'; export default createRulesetFunction<{ parameters: Record }, null>( { - input: null, + input: { + type: 'object', + properties: { + parameters: { + type: 'object', + } + }, + required: ['parameters'], + }, options: null, }, function asyncApi2ChannelParameters(targetVal, _, ctx) { diff --git a/packages/rulesets/src/asyncapi/functions/asyncApi2ServerVariables.ts b/packages/rulesets/src/asyncapi/functions/asyncApi2ServerVariables.ts index 2d7023a9d..e876cced5 100644 --- a/packages/rulesets/src/asyncapi/functions/asyncApi2ServerVariables.ts +++ b/packages/rulesets/src/asyncapi/functions/asyncApi2ServerVariables.ts @@ -8,7 +8,18 @@ import type { IFunctionResult } from '@stoplight/spectral-core'; export default createRulesetFunction<{ url: string; variables: Record }, null>( { - input: null, + input: { + type: 'object', + properties: { + url: { + type: 'string', + }, + variables: { + type: 'object', + } + }, + required: ['url', 'variables'], + }, options: null, }, function asyncApi2ServerVariables(targetVal, _, ctx) {