Skip to content

Commit

Permalink
Update BREAKING-CHANGES.md
Browse files Browse the repository at this point in the history
  • Loading branch information
reuvenharrison authored May 19, 2024
1 parent bcfaf3a commit 5ce7b63
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions docs/BREAKING-CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,18 +34,18 @@ By default, changes are displayed as human-readable text with [color](#color).
You can specify the `--format` flag to output changes in other formats: `json`, `yaml`, `githubactions` or `junit`.
An additional format `singleline` displays each change on a single line, this can be useful to prepare [ignore files](#ignoring-specific-breaking-changes)

### Preventing Breaking Changes
A common way to use oasdiff is by running it as a step the CI/CD pipeline to detect changes.
In order to prevent changes, oasdiff can be configured to return an error if changes above a certain level are found.
- To exit with return code 1 if ERR breaking changes are found, add the `--fail-on ERR` flag.
- To exit with return code 1 if ERR or WARN breaking changes are found, add the `--fail-on WARN` flag.
- To exit with return code 1 if any changes are found, add the `--fail-on INFO` flag.

### Color
When outputting changes to a Unix terminal, oasdiff automatically adds colors with ANSI color escape sequences.
If output is piped into another process or redirected to a file, oasdiff disables color.
To control color manually, use the `--color` flag with `always` or `never`.

### Preventing Breaking Changes
A common way to use oasdiff is by running it as a step the CI/CD pipeline to detect changes.
In order to prevent changes, oasdiff can be configured to return an error if changes above a certain level are found.
- To exit with return code 1 if ERR-level changes are found, add the `--fail-on ERR` flag.
- To exit with return code 1 if ERR-level or WARN-level changes are found, add the `--fail-on WARN` flag.
- To exit with return code 1 if any changes are found, add the `--fail-on INFO` flag.

### API Stability Levels
When a new API is introduced, you may want to allow developers to change its behavior without triggering a breaking change error.
You can define an endpoint's stability level with the `x-stability-level` extension.
Expand Down Expand Up @@ -119,7 +119,7 @@ Currently English and Russian are supported.

### Customizing Breaking Changes Checks
If you encounter a change that isn't considered breaking by oasdiff you may:
1. Check if the change is already available as an [optional breaking changes check](#optional-checks).
1. Check if the change is already available as an [optional check](#optional-checks).
2. Add a [custom check](CUSTOMIZING-CHECKS.md)

### Additional Options
Expand All @@ -145,17 +145,17 @@ oasdiff breaking https://raw.githubusercontent.com/Tufin/oasdiff/main/data/opena

#### Breaking changes as YAML
```
oasdiff breaking https://raw.githubusercontent.com/Tufin/oasdiff/main/data/openapi-test1.yaml https://raw.githubusercontent.com/Tufin/oasdiff/main/data/openapi-test3.yaml -f yaml
oasdiff breaking -f yaml https://raw.githubusercontent.com/Tufin/oasdiff/main/data/openapi-test1.yaml https://raw.githubusercontent.com/Tufin/oasdiff/main/data/openapi-test3.yaml
```

#### Breaking changes across multiple specs with globs
```
oasdiff breaking "data/composed/base/*.yaml" "data/composed/revision/*.yaml" -c
oasdiff breaking -c "data/composed/base/*.yaml" "data/composed/revision/*.yaml"
```

#### Breaking changes with exit code 1 if any ERR-level breaking changes are found
```
oasdiff breaking "data/composed/base/*.yaml" "data/composed/revision/*.yaml" -c -o ERR
oasdiff breaking -c -o ERR "data/composed/base/*.yaml" "data/composed/revision/*.yaml"
```

#### Changelog
Expand Down

0 comments on commit 5ce7b63

Please sign in to comment.