You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: README.md
+12
Original file line number
Diff line number
Diff line change
@@ -61,6 +61,7 @@ references as if it had been generated in the "correct" folder. This allows the
61
61
when compiling TypeSpec files. If omitted, the tool will attempt to resolve the references without it.
62
62
-`--rhs-root`: The root path for the right-hand side Swagger files. This is used to resolve references
63
63
when compiling TypeSpec files. If omitted, the tool will attempt to resolve the references without it.
64
+
-`--suppressions`: Path to a YAML file containing suppressions.
64
65
65
66
### .env File
66
67
@@ -141,3 +142,14 @@ rule can make one of three determinations:
141
142
-`RuleResult.ContinueProcessing`: the logic of the rule doesn't apply to this diff and thus the tool should continue processing rules.
142
143
143
144
When processing a diff item against the rules, if `NoViolation` is returned by a rule, it immediately suspends processing additional rules. If `FlaggedViolation` is returned, rules will continue to be processed in case another rule marks it as `NoViolation`. If all rules are run and no determination is made, then the diff is assumed to affect the API surface area and is tracked as an assumed violation. It will be reported by the tool and will appear in a visual diff. When violations are grouped, these violations will appear in the `UNGROUPED` group.
145
+
146
+
## Suppressions
147
+
148
+
It is possible that there will be differences between Swaggers that do matter but must be accepted. For this, you can point to a suppression file using the `--suppressions` option. This file should be a YAML file with the following schema:
149
+
150
+
```yaml
151
+
- path: "path/to/target/"
152
+
reason: "This is a reason why this path is suppressed."
153
+
```
154
+
155
+
You can target paths directly from the `diff.json` file assuming `--flatten-paths` is used; however, often violations originate in definitions or parameters, and the way `rest-api-diff` expands these references to create the transformation, the result is that these diffs will be multiplied. In this case, you can use the path to the element in question from the Swagger and it will automatically resolve all diffs that might be a result of reference expansion. Because `rest-api-diff` compares these as Swagger, you cannot use a TypeSpec path even if you are targeting TypeSpec. You must use the Swagger path associated with the TypeSpec-generated Swagger.
0 commit comments