Skip to content

Commit 54bc377

Browse files
feat: removed parameters-not-in-body rule (#1832)
1 parent 125d240 commit 54bc377

20 files changed

+50
-208
lines changed

.changeset/tasty-poems-fly.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@redocly/openapi-core": patch
3+
---
4+
5+
Updated Spot validation rules.

docs/guides/lint-arazzo.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ extends:
8282

8383
arazzoRules:
8484
sourceDescription-name-unique: warn
85-
version-enum: error
85+
spot-supported-versions: error
8686
```
8787
8888
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.

docs/rules/built-in-rules.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,7 @@ Within the Arazzo family of rules, there are rules for the main Arazzo specifica
135135
The below rules are being migrated to Spot:
136136

137137
- [no-criteria-xpath](./spot/no-criteria-xpath.md): the `xpath` type criteria is not supported by Spot.
138-
- [parameters-not-in-body](./spot/parameters-not-in-body.md): the `in` section inside `parameters` must not contain a `body`.
139-
- [version-enum](./spot/version-enum.md): the `version` property must be one of the supported values.
138+
- [spot-supported-versions](./spot/spot-supported-versions.md): the `version` property must be one of the supported values.
140139

141140
## Resources
142141

docs/rules/ruleset-templates.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -221,16 +221,15 @@ rules:
221221
```yaml
222222
rules:
223223
struct: error
224-
parameters-not-in-body: off
225224
sourceDescription-type: off
226-
version-enum: warn
227225
workflowId-unique: error
228226
stepId-unique: error
229227
sourceDescription-name-unique: off
230228
workflow-dependsOn: off
231229
parameters-unique: off
232230
step-onSuccess-unique: off
233231
step-onFailure-unique: off
232+
spot-supported-versions: off
234233
requestBody-replacements-unique: off
235234
no-criteria-xpath: off
236235
no-actions-type-end: off
@@ -491,18 +490,17 @@ rules:
491490
```yaml
492491
rules:
493492
struct: error
494-
parameters-not-in-body: warn
495493
sourceDescription-type: error
496-
version-enum: warn
497494
workflowId-unique: error
498495
stepId-unique: error
499496
sourceDescription-name-unique: error
500497
workflow-dependsOn: error
501498
parameters-unique: error
502499
step-onSuccess-unique: warn
503500
step-onFailure-unique: warn
501+
spot-supported-versions: off
504502
requestBody-replacements-unique: warn
505-
no-criteria-xpath: warn
503+
no-criteria-xpath: off
506504
no-actions-type-end: warn
507505
criteria-unique: warn
508506
```

docs/rules/spec-ruleset.md

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,18 @@ slug: /docs/cli/rules/spec
77
This ruleset strictly follows the specifications.
88
All the rules are of severity `error`:
99

10-
- `struct`
10+
- [struct](./arazzo/struct.md)
11+
- [criteria-unique](./arazzo/criteria-unique.md)
12+
- [sourceDescription-type](./arazzo/sourceDescriptions-type.md)
13+
- [spot-supported-versions](./spot/spot-supported-versions.md)
14+
- [workflowId-unique](./arazzo/workflowId-unique.md)
15+
- [stepId-unique](./arazzo/stepId-unique.md)
16+
- [sourceDescription-name-unique](./arazzo/sourceDescriptions-name-unique.md)
17+
- [sourceDescriptions-not-empty](./arazzo/sourceDescriptions-not-empty.md)
18+
- [workflow-dependsOn](./arazzo/workflow-dependsOn.md)
19+
- [parameters-unique](./arazzo/parameters-unique.md)
20+
- [step-onSuccess-unique](./arazzo/step-onSuccess-unique.md)
21+
- [step-onFailure-unique](./arazzo/step-onFailure-unique.md)
22+
- [requestBody-replacements-unique](./arazzo/requestBody-replacements-unique.md)
23+
- [no-criteria-xpath](./spot/no-criteria-xpath.md)
1124
- [criteria-unique](./arazzo/criteria-unique.md)
12-
- `parameters-not-in-body`
13-
- `sourceDescription-type`
14-
- `version-enum`
15-
- `workflowId-unique`
16-
- `stepId-unique`
17-
- `sourceDescription-name-unique`
18-
- `sourceDescriptions-not-empty`
19-
- `workflow-dependsOn`
20-
- `parameters-unique`
21-
- `step-onSuccess-unique`
22-
- `step-onFailure-unique`
23-
- `requestBody-replacements-unique`
24-
- `no-criteria-xpath`
25-
- `criteria-unique`

docs/rules/spot/parameters-not-in-body.md

Lines changed: 0 additions & 58 deletions
This file was deleted.

docs/rules/spot/version-enum.md renamed to docs/rules/spot/spot-supported-versions.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# version-enum
1+
# spot-supported-versions
22

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

@@ -21,7 +21,7 @@ An example configuration:
2121

2222
```yaml
2323
arazzoRules:
24-
version-enum: error
24+
spot-supported-versions: error
2525
```
2626
2727
## Examples
@@ -30,7 +30,7 @@ Given the following configuration:
3030
3131
```yaml
3232
arazzoRules:
33-
version-enum: error
33+
spot-supported-versions: error
3434
```
3535
3636
Example of a **correct** entry:
@@ -41,8 +41,8 @@ arazzo: 1.0.0
4141
4242
## Related rules
4343
44-
- [parameters-not-in-body](./parameters-not-in-body.md)
44+
- [no-criteria-xpath](./no-criteria-xpath.md)
4545
4646
## Resources
4747
48-
- [Rule source](https://github.com/Redocly/redocly-cli/blob/main/packages/core/src/rules/spot/version-enum.ts)
48+
- [Rule source](https://github.com/Redocly/redocly-cli/blob/main/packages/core/src/rules/spot/spot-supported-versions.ts)

docs/sidebars.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,8 +139,7 @@
139139
- page: rules/async/no-channel-trailing-slash.md
140140
- separator: Arazzo
141141
- page: rules/spot/no-criteria-xpath.md
142-
- page: rules/spot/version-enum.md
143-
- page: rules/spot/parameters-not-in-body.md
142+
- page: rules/spot/spot-supported-versions.md
144143
- page: rules/arazzo/criteria-unique.md
145144
- page: rules/arazzo/parameters-unique.md
146145
- page: rules/arazzo/requestBody-replacements-unique.md

packages/core/src/config/__tests__/__snapshots__/config-resolvers.test.ts.snap

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,16 @@ exports[`resolveConfig should ignore minimal from the root and read local file 1
66
"arazzo1Preprocessors": {},
77
"arazzo1Rules": {
88
"criteria-unique": "warn",
9-
"no-criteria-xpath": "warn",
10-
"parameters-not-in-body": "warn",
9+
"no-criteria-xpath": "off",
1110
"parameters-unique": "error",
1211
"requestBody-replacements-unique": "warn",
1312
"sourceDescription-name-unique": "error",
1413
"sourceDescription-type": "error",
1514
"sourceDescriptions-not-empty": "error",
15+
"spot-supported-versions": "off",
1616
"step-onFailure-unique": "warn",
1717
"step-onSuccess-unique": "warn",
1818
"stepId-unique": "error",
19-
"version-enum": "warn",
2019
"workflow-dependsOn": "error",
2120
"workflowId-unique": "error",
2221
},
@@ -233,17 +232,16 @@ exports[`resolveStyleguideConfig should resolve extends with local file config w
233232
"arazzo1Preprocessors": {},
234233
"arazzo1Rules": {
235234
"criteria-unique": "warn",
236-
"no-criteria-xpath": "warn",
237-
"parameters-not-in-body": "warn",
235+
"no-criteria-xpath": "off",
238236
"parameters-unique": "error",
239237
"requestBody-replacements-unique": "warn",
240238
"sourceDescription-name-unique": "error",
241239
"sourceDescription-type": "error",
242240
"sourceDescriptions-not-empty": "error",
241+
"spot-supported-versions": "off",
243242
"step-onFailure-unique": "warn",
244243
"step-onSuccess-unique": "warn",
245244
"stepId-unique": "error",
246-
"version-enum": "warn",
247245
"workflow-dependsOn": "error",
248246
"workflowId-unique": "error",
249247
},

packages/core/src/config/all.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -210,8 +210,7 @@ const all: PluginStyleguideConfig<'built-in'> = {
210210
},
211211
arazzo1Rules: {
212212
'criteria-unique': 'error',
213-
'no-criteria-xpath': 'error',
214-
'parameters-not-in-body': 'error',
213+
'no-criteria-xpath': 'off',
215214
'parameters-unique': 'error',
216215
'requestBody-replacements-unique': 'error',
217216
'sourceDescription-type': 'error',
@@ -220,7 +219,7 @@ const all: PluginStyleguideConfig<'built-in'> = {
220219
'stepId-unique': 'error',
221220
'sourceDescription-name-unique': 'error',
222221
'sourceDescriptions-not-empty': 'error',
223-
'version-enum': 'error',
222+
'spot-supported-versions': 'off',
224223
'workflowId-unique': 'error',
225224
'workflow-dependsOn': 'error',
226225
},

0 commit comments

Comments
 (0)