Skip to content

Commit

Permalink
feat(rulesets): fix docs
Browse files Browse the repository at this point in the history
  • Loading branch information
magicmatatjahu committed May 19, 2022
1 parent b33df5d commit efd4116
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 4 deletions.
4 changes: 2 additions & 2 deletions docs/reference/asyncapi-rules.md
Expand Up @@ -24,7 +24,7 @@ Keep trailing slashes off of channel names, as it can cause some confusion. Most

**Recommended:** Yes

### asyncapi-channel-parameters-defined
### asyncapi-channel-parameters

All channel parameters should be defined in the `parameters` object of the channel. They should also not contain redundant parameters that do not exist in the channel address.

Expand Down Expand Up @@ -294,7 +294,7 @@ Server URL should not point at example.com.

**Recommended:** No

### asyncapi-server-variables-defined
### asyncapi-server-variables

All server URL variables should be defined in the `variables` object of the server. They should also not contain redundant variables that do not exist in the server address.

Expand Down
Expand Up @@ -8,7 +8,15 @@ import type { IFunctionResult } from '@stoplight/spectral-core';

export default createRulesetFunction<{ parameters: Record<string, unknown> }, null>(
{
input: null,
input: {
type: 'object',
properties: {
parameters: {
type: 'object',
}
},
required: ['parameters'],
},
options: null,
},
function asyncApi2ChannelParameters(targetVal, _, ctx) {
Expand Down
Expand Up @@ -8,7 +8,18 @@ import type { IFunctionResult } from '@stoplight/spectral-core';

export default createRulesetFunction<{ url: string; variables: Record<string, unknown> }, null>(
{
input: null,
input: {
type: 'object',
properties: {
url: {
type: 'string',
},
variables: {
type: 'object',
}
},
required: ['url', 'variables'],
},
options: null,
},
function asyncApi2ServerVariables(targetVal, _, ctx) {
Expand Down

0 comments on commit efd4116

Please sign in to comment.