@quobix/vacuum 0.35.0 → 0.35.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +34 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -568,9 +568,32 @@ recognizes a compressed report file and will deal with it automatically when rea
|
|
|
568
568
|
|
|
569
569
|
> When using compression, the file name will be `vacuum-report-MM-DD-YY-HH_MM_SS.json.gz`. vacuum uses gzip internally.
|
|
570
570
|
|
|
571
|
+
## Selecting property names in custom rules
|
|
572
|
+
|
|
573
|
+
Use quoted bracket notation for JSONPath property names with special characters, for example `['$ref']` and `['application/json']`. A single leading backtick also escapes a member name in dot notation or an unquoted bracket selector:
|
|
574
|
+
|
|
575
|
+
~~~text
|
|
576
|
+
$.paths.*.*.requestBody.content.`application/json.schema.`$ref
|
|
577
|
+
~~~
|
|
578
|
+
|
|
579
|
+
There is no closing backtick; a trailing backtick becomes part of the property name. Use quoted bracket notation for names that contain path separators or whitespace, and for properties inside filters. Quoted names keep literal backticks unchanged.
|
|
580
|
+
|
|
581
|
+
To inspect a `$ref` property itself, set `resolved: false`. With `resolved: true`, rules inspect the referenced schema after resolution.
|
|
582
|
+
|
|
583
|
+
```yaml
|
|
584
|
+
rules:
|
|
585
|
+
no-request-body-refs:
|
|
586
|
+
description: Request body schemas must be inline.
|
|
587
|
+
given: "$.paths.*.*.requestBody.content['application/json'].schema['$ref']"
|
|
588
|
+
resolved: false
|
|
589
|
+
severity: warn
|
|
590
|
+
then:
|
|
591
|
+
function: falsy
|
|
592
|
+
```
|
|
593
|
+
|
|
571
594
|
## Ignoring specific linting errors
|
|
572
595
|
|
|
573
|
-
You can ignore specific linting errors by providing an `--ignore-file` argument to commands that run or replay lint results, including `lint`, `report`, `spectral-report`, `html-report`, `dashboard`, and `
|
|
596
|
+
You can ignore specific linting errors by providing an `--ignore-file` argument to commands that run or replay lint results, including `lint`, `report`, `spectral-report`, `html-report`, `dashboard`, `docs`, `schema`, and `language-server`.
|
|
574
597
|
|
|
575
598
|
```
|
|
576
599
|
./vacuum lint --ignore-file <path-to-ignore-file.yaml> -d <your-openapi-spec.yaml>
|
|
@@ -580,6 +603,16 @@ You can ignore specific linting errors by providing an `--ignore-file` argument
|
|
|
580
603
|
./vacuum report --ignore-file <path-to-ignore-file.yaml> -c <your-openapi-spec.yaml> <report-prefix>
|
|
581
604
|
```
|
|
582
605
|
|
|
606
|
+
Repeat `--ignore-file` to combine waivers from multiple files. Paths for the same rule are appended; an unreadable or invalid file stops the command.
|
|
607
|
+
|
|
608
|
+
```sh
|
|
609
|
+
./vacuum lint --ignore-file pets-ignore.yaml --ignore-file stores-ignore.yaml api.yaml
|
|
610
|
+
```
|
|
611
|
+
|
|
612
|
+
In `vacuum.conf.yaml`, `ignore-file` accepts either one path or a YAML list of paths. A scalar value, including `VACUUM_IGNORE_FILE`, is always one path; commas are part of the filename.
|
|
613
|
+
|
|
614
|
+
Language-server editor settings accept `ignoreFiles: ["one.yaml", "two.yaml"]`; the legacy `ignoreFile` string still works. An empty `ignoreFiles` list clears waivers. Explicit CLI ignore files override disk config; editor initialization and workspace settings can override the CLI defaults.
|
|
615
|
+
|
|
583
616
|
The ignore-file should point to a `.yaml` file that contains exact result paths or JSONPath expressions to be ignored by vacuum. The structure of the YAML file is as follows:
|
|
584
617
|
|
|
585
618
|
```
|