| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [View Raw Code] [Original HTTPS Page] |
If you version your API with semantic versioning, a breaking change is supposed to come with a major version bump.
Oasdiff can tell you when it didn't, because it already knows both halves: the severity of the change, and info.version on each side.
The policy is one rule: a breaking change requires a major version increase. There are three ways to break it, each with its own check id:
| Check id | Reported when a breaking change was detected and |
|---|---|
| api-version-not-bumped | info.version is unchanged |
| api-version-decreased | info.version moved backwards, for example 2.0.0 to 1.0.0 |
| api-major-version-not-bumped | info.version moved, but the major version did not increase, for example 1.0.0 to 1.1.0 |
For example:
info [api-major-version-not-bumped]
in info
a breaking change was detected but the major version did not increase, from '1.0.0' to '1.1.0'
Their default level is INFO, so they never fail a build on their own.
To fail the build, raise the checks to ERR with custom severity levels:
oasdiff breaking base.yaml revision.yaml --severity-levels oasdiff-levels.txt --fail-on ERR
Where oasdiff-levels.txt contains:
api-version-not-bumped err api-version-decreased err api-major-version-not-bumped err
If you don't want these checks at all, set them to none in the same file:
api-version-not-bumped none api-version-decreased none api-major-version-not-bumped none
Nothing is reported unless both of these hold:
Below 1.0.0, semver gives the minor version the major's role, so 0.1.0 to 0.2.0 carries a breaking change and 0.1.0 to 0.1.1 does not.
| Back | FazBrowse Home | New Git URL |