Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ toc:

### Minor Changes

- Added Spot and Arazzo rules: `no-criteria-xpath`, `no-actions-type-end`, `criteria-unique`.
- Added Respect and Arazzo rules: `no-criteria-xpath`, `no-actions-type-end`, `criteria-unique`.

### Patch Changes

Expand Down
2 changes: 1 addition & 1 deletion docs/guides/lint-arazzo.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ extends:

arazzoRules:
sourceDescription-name-unique: warn
spot-supported-versions: error
respect-supported-versions: error
```

The configuration shown here gives some good entry-level linting using the `minimal` standard, and adds checks that we're using a supported version of Arazzo, and warns if each source description doesn't have a unique name.
Expand Down
10 changes: 5 additions & 5 deletions docs/rules/built-in-rules.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ Other rules such as the `spec` and `info.*` rules also apply to AsyncAPI.

## Arazzo rules

Within the Arazzo family of rules, there are rules for the main Arazzo specification format, and some additional rules for extensions supported by Spot, the Redocly testing utility.
Within the Arazzo family of rules, there are rules for the main Arazzo specification format, and some additional rules for extensions supported by Respect, the Redocly testing utility.

### Arazzo

Expand All @@ -131,12 +131,12 @@ Within the Arazzo family of rules, there are rules for the main Arazzo specifica
- [workflowId-unique](./arazzo/workflowId-unique.md): the `workflowId` property must be unique across all workflows
- [sourceDescriptions-not-empty](./arazzo/sourceDescriptions-not-empty.md): the `sourceDescriptions` must be defined and the list must have at least one entry.

### Spot [ deprecated ]
### Respect [ deprecated ]

The below rules are being migrated to Spot:
The below rules are being migrated to Respect:

- [no-criteria-xpath](./spot/no-criteria-xpath.md): the `xpath` type criteria is not supported by Spot.
- [spot-supported-versions](./spot/spot-supported-versions.md): the `version` property must be one of the supported values.
- [no-criteria-xpath](./respect/no-criteria-xpath.md): the `xpath` type criteria is not supported by Respect.
- [respect-supported-versions](./respect/respect-supported-versions.md): the `version` property must be one of the supported values.

## Resources

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# spot-supported-versions
# respect-supported-versions

The `version` property must be one of the supported values.

Expand Down
4 changes: 2 additions & 2 deletions docs/rules/ruleset-templates.md
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ rules:
parameters-unique: off
step-onSuccess-unique: off
step-onFailure-unique: off
spot-supported-versions: off
respect-supported-versions: off
requestBody-replacements-unique: off
no-criteria-xpath: off
no-actions-type-end: off
Expand Down Expand Up @@ -498,7 +498,7 @@ rules:
parameters-unique: error
step-onSuccess-unique: warn
step-onFailure-unique: warn
spot-supported-versions: off
respect-supported-versions: off
requestBody-replacements-unique: warn
no-criteria-xpath: off
no-actions-type-end: warn
Expand Down
4 changes: 2 additions & 2 deletions docs/rules/spec-ruleset.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ All the rules are of severity `error`:
- [struct](./arazzo/struct.md)
- [criteria-unique](./arazzo/criteria-unique.md)
- [sourceDescription-type](./arazzo/sourceDescriptions-type.md)
- [spot-supported-versions](./spot/spot-supported-versions.md)
- [respect-supported-versions](./respect/respect-supported-versions.md)
- [workflowId-unique](./arazzo/workflowId-unique.md)
- [stepId-unique](./arazzo/stepId-unique.md)
- [sourceDescription-name-unique](./arazzo/sourceDescriptions-name-unique.md)
Expand All @@ -20,5 +20,5 @@ All the rules are of severity `error`:
- [step-onSuccess-unique](./arazzo/step-onSuccess-unique.md)
- [step-onFailure-unique](./arazzo/step-onFailure-unique.md)
- [requestBody-replacements-unique](./arazzo/requestBody-replacements-unique.md)
- [no-criteria-xpath](./spot/no-criteria-xpath.md)
- [no-criteria-xpath](./respect/no-criteria-xpath.md)
- [criteria-unique](./arazzo/criteria-unique.md)
4 changes: 2 additions & 2 deletions docs/sidebars.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,8 @@
- page: rules/async/channels-kebab-case.md
- page: rules/async/no-channel-trailing-slash.md
- separator: Arazzo
- page: rules/spot/no-criteria-xpath.md
- page: rules/spot/spot-supported-versions.md
- page: rules/respect/no-criteria-xpath.md
- page: rules/respect/respect-supported-versions.md
- page: rules/arazzo/criteria-unique.md
- page: rules/arazzo/parameters-unique.md
- page: rules/arazzo/requestBody-replacements-unique.md
Expand Down
8 changes: 4 additions & 4 deletions packages/core/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

### Patch Changes

- Added support for Arazzo version 1.0.1 in Spot validation rules.
- Added support for Arazzo version 1.0.1 in Respect validation rules.

## 1.28.1

Expand Down Expand Up @@ -73,13 +73,13 @@

### Patch Changes

- Updated Spot validation rules.
- Updated Respect validation rules.

## 1.26.1

### Patch Changes

- Removed the `no-actions-type-end` Spot rule.
- Removed the `no-actions-type-end` Respect rule.
- Removed unused lodash.isequal dependency.

## 1.26.0
Expand Down Expand Up @@ -202,7 +202,7 @@

### Minor Changes

- Added Spot and Arazzo rules: `no-criteria-xpath`, `no-actions-type-end`, `criteria-unique`.
- Added Respect and Arazzo rules: `no-criteria-xpath`, `no-actions-type-end`, `criteria-unique`.

### Patch Changes

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ exports[`resolveConfig should ignore minimal from the root and read local file 1
"no-criteria-xpath": "off",
"parameters-unique": "error",
"requestBody-replacements-unique": "warn",
"respect-supported-versions": "off",
"sourceDescription-name-unique": "error",
"sourceDescription-type": "error",
"sourceDescriptions-not-empty": "error",
"spot-supported-versions": "off",
"step-onFailure-unique": "warn",
"step-onSuccess-unique": "warn",
"stepId-unique": "error",
Expand Down Expand Up @@ -238,10 +238,10 @@ exports[`resolveStyleguideConfig should resolve extends with local file config w
"no-criteria-xpath": "off",
"parameters-unique": "error",
"requestBody-replacements-unique": "warn",
"respect-supported-versions": "off",
"sourceDescription-name-unique": "error",
"sourceDescription-type": "error",
"sourceDescriptions-not-empty": "error",
"spot-supported-versions": "off",
"step-onFailure-unique": "warn",
"step-onSuccess-unique": "warn",
"stepId-unique": "error",
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/config/all.ts
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ const all: PluginStyleguideConfig<'built-in'> = {
'stepId-unique': 'error',
'sourceDescription-name-unique': 'error',
'sourceDescriptions-not-empty': 'error',
'spot-supported-versions': 'off',
'respect-supported-versions': 'off',
'workflowId-unique': 'error',
'workflow-dependsOn': 'error',
},
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/config/minimal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ const minimal: PluginStyleguideConfig<'built-in'> = {
'step-onFailure-unique': 'off',
'stepId-unique': 'error',
'sourceDescription-name-unique': 'off',
'spot-supported-versions': 'off',
'respect-supported-versions': 'off',
'workflowId-unique': 'error',
'workflow-dependsOn': 'off',
},
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/config/recommended-strict.ts
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ const recommendedStrict: PluginStyleguideConfig<'built-in'> = {
'stepId-unique': 'error',
'sourceDescription-name-unique': 'error',
'sourceDescriptions-not-empty': 'error',
'spot-supported-versions': 'off',
'respect-supported-versions': 'off',
'workflowId-unique': 'error',
'workflow-dependsOn': 'error',
},
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/config/recommended.ts
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ const recommended: PluginStyleguideConfig<'built-in'> = {
'stepId-unique': 'error',
'sourceDescription-name-unique': 'error',
'sourceDescriptions-not-empty': 'error',
'spot-supported-versions': 'off',
'respect-supported-versions': 'off',
'workflowId-unique': 'error',
'workflow-dependsOn': 'error',
},
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/config/spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const spec: PluginStyleguideConfig<'built-in'> = {
async3Rules: {},
arazzo1Rules: {
'sourceDescription-type': 'error',
'spot-supported-versions': 'off',
'respect-supported-versions': 'off',
'workflowId-unique': 'error',
'stepId-unique': 'error',
'sourceDescription-name-unique': 'error',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ describe('Arazzo no-criteria-xpath', () => {
"source": "arazzo.yaml",
},
],
"message": "The \`xpath\` type criteria is not supported by Spot.",
"message": "The \`xpath\` type criteria is not supported by Respect.",
"ruleId": "no-criteria-xpath",
"severity": "error",
"suggest": [],
Expand All @@ -103,7 +103,7 @@ describe('Arazzo no-criteria-xpath', () => {
"source": "arazzo.yaml",
},
],
"message": "The \`xpath\` type criteria is not supported by Spot.",
"message": "The \`xpath\` type criteria is not supported by Respect.",
"ruleId": "no-criteria-xpath",
"severity": "error",
"suggest": [],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { lintDocument } from '../../../lint';
import { parseYamlToDocument, replaceSourceWithRef, makeConfig } from '../../../../__tests__/utils';
import { BaseResolver } from '../../../resolve';

describe('Arazzo spot-supported-versions', () => {
describe('Arazzo respect-supported-versions', () => {
const documentWithUnsupportedVersion = parseYamlToDocument(
outdent`
arazzo: '1.0.2'
Expand Down Expand Up @@ -67,7 +67,7 @@ describe('Arazzo spot-supported-versions', () => {
externalRefResolver: new BaseResolver(),
document: documentWithUnsupportedVersion,
config: await makeConfig({
rules: { 'spot-supported-versions': 'error' },
rules: { 'respect-supported-versions': 'error' },
}),
});

Expand All @@ -81,8 +81,8 @@ describe('Arazzo spot-supported-versions', () => {
"source": "arazzo.yaml",
},
],
"message": "Only 1.0.1 Arazzo version is supported by Spot.",
"ruleId": "spot-supported-versions",
"message": "Only 1.0.1 Arazzo version is supported by Respect.",
"ruleId": "respect-supported-versions",
"severity": "error",
"suggest": [],
},
Expand All @@ -95,7 +95,7 @@ describe('Arazzo spot-supported-versions', () => {
externalRefResolver: new BaseResolver(),
document: documentWithSupportedVersion,
config: await makeConfig({
rules: { 'spot-supported-versions': 'error' },
rules: { 'respect-supported-versions': 'error' },
}),
});

Expand Down
6 changes: 3 additions & 3 deletions packages/core/src/rules/arazzo/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Struct } from '../common/struct';
import { Assertions } from '../common/assertions';
import { SourceDescriptionType } from '../arazzo/sourceDescription-type';
import { SourceDescriptionsNotEmpty } from './sourceDescriptions-not-empty';
import { SpotSupportedVersions } from '../spot/spot-supported-versions';
import { RespectSupportedVersions } from '../respect/respect-supported-versions';
import { WorkflowIdUnique } from './workflowId-unique';
import { StepIdUnique } from './stepId-unique';
import { SourceDescriptionsNameUnique } from './sourceDescriptions-name-unique';
Expand All @@ -11,7 +11,7 @@ import { ParametersUnique } from './parameters-unique';
import { StepOnSuccessUnique } from './step-onSuccess-unique';
import { StepOnFailureUnique } from './step-onFailure-unique';
import { RequestBodyReplacementsUnique } from './requestBody-replacements-unique';
import { NoCriteriaXpath } from '../spot/no-criteria-xpath';
import { NoCriteriaXpath } from '../respect/no-criteria-xpath';
import { CriteriaUnique } from './criteria-unique';

import type { Arazzo1Rule } from '../../visitors';
Expand All @@ -21,7 +21,7 @@ export const rules: Arazzo1RuleSet<'built-in'> = {
struct: Struct as Arazzo1Rule,
assertions: Assertions as Arazzo1Rule,
'sourceDescription-type': SourceDescriptionType,
'spot-supported-versions': SpotSupportedVersions,
'respect-supported-versions': RespectSupportedVersions,
'workflowId-unique': WorkflowIdUnique,
'stepId-unique': StepIdUnique,
'sourceDescription-name-unique': SourceDescriptionsNameUnique,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export const NoCriteriaXpath: Arazzo1Rule = () => {
}
if (criteria?.type?.type === 'xpath' || criteria?.type === 'xpath') {
report({
message: 'The `xpath` type criteria is not supported by Spot.',
message: 'The `xpath` type criteria is not supported by Respect.',
location: location.child(['type']),
});
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
import { ARAZZO_VERSIONS_SUPPORTED_BY_SPOT } from '../../typings/arazzo';
import { ARAZZO_VERSIONS_SUPPORTED_BY_RESPECT } from '../../typings/arazzo';
import { pluralize } from '../../utils';

import type { Arazzo1Rule } from '../../visitors';
import type { UserContext } from '../../walk';

export const SpotSupportedVersions: Arazzo1Rule = () => {
const supportedVersions = ARAZZO_VERSIONS_SUPPORTED_BY_SPOT.join(', ');
export const RespectSupportedVersions: Arazzo1Rule = () => {
const supportedVersions = ARAZZO_VERSIONS_SUPPORTED_BY_RESPECT.join(', ');
return {
Root: {
enter(root, { report, location }: UserContext) {
if (!ARAZZO_VERSIONS_SUPPORTED_BY_SPOT.includes(root.arazzo)) {
if (!ARAZZO_VERSIONS_SUPPORTED_BY_RESPECT.includes(root.arazzo)) {
report({
message: `Only ${supportedVersions} Arazzo ${pluralize(
'version is',
ARAZZO_VERSIONS_SUPPORTED_BY_SPOT.length
)} supported by Spot.`,
ARAZZO_VERSIONS_SUPPORTED_BY_RESPECT.length
)} supported by Respect.`,
location: location.child('arazzo'),
});
}
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/types/redocly-yaml.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ const builtInArazzo1Rules = [
'parameters-unique',
'step-onSuccess-unique',
'step-onFailure-unique',
'spot-supported-versions',
'respect-supported-versions',
'requestBody-replacements-unique',
'no-criteria-xpath',
'criteria-unique',
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/typings/arazzo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -169,4 +169,4 @@ export interface ArazzoDefinition {

export const VERSION_PATTERN = /^1\.0\.\d+(-.+)?$/;

export const ARAZZO_VERSIONS_SUPPORTED_BY_SPOT = ['1.0.1'];
export const ARAZZO_VERSIONS_SUPPORTED_BY_RESPECT = ['1.0.1'];
Original file line number Diff line number Diff line change
Expand Up @@ -1547,7 +1547,7 @@ describe('runStep', () => {
});

expect(displayChecks).toHaveBeenCalled();
expect(checkCriteria).toHaveBeenCalledTimes(5);
expect(checkCriteria).toHaveBeenCalledTimes(3);
});

it('should result with an error when onFailure step criteria with retry StepId and WorkflowId provided', async () => {
Expand Down Expand Up @@ -1790,7 +1790,7 @@ describe('runStep', () => {
});

expect(displayChecks).toHaveBeenCalled();
expect(checkCriteria).toHaveBeenCalledTimes(5);
expect(checkCriteria).toHaveBeenCalledTimes(3);
});

it('should execute onFailure step criteria with successful retry', async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export async function bundleArazzo(filePath: string) {
extends: ['recommended-strict'],
arazzo1Rules: {
'no-criteria-xpath': 'error',
'spot-supported-versions': 'error',
'respect-supported-versions': 'error',
},
});

Expand Down
Loading