Skip to content

Semver & Versioning

Grapity auto-assigns semantic versions based on compatibility analysis. You can also declare an explicit version for intentional major releases.

Auto-assigned versions

On every push, the Registry classifies the change and bumps the version accordingly.

Change classificationRelease bumpPre-release bump
Breaking change1.2.02.0.00.2.00.3.0
Safe addition (minor)1.2.01.3.00.2.00.3.0
Patch (no API change)1.2.01.2.10.2.00.2.1
First push (no previous)1.0.00.1.0

Pre-release lifecycle

Use --prerelease to push versions in the 0.x range:

bash
grapity registry push ./openapi.yaml --name payments-api --prerelease

Rules:

  • Pre-release is only allowed when the spec does not exist yet, or the previous version is also pre-release.
  • Once a spec has a release version (1.0.0+), it cannot go back to pre-release. Graduation is one-way.
  • In pre-release (0.x), breaking changes bump minor, following semver convention for 0.x versions.

Explicit version declaration

Declare the intended target semver to signal an intentional major release:

bash
grapity registry push ./openapi.yaml --name payments-api --version 2.0.0
ScenarioResult
Declared major + breaking changes detectedAccepted as intentional major release
Declared minor/patch + breaking changes detectedBlocked with 409 (wrong version type)
No version declaredAuto-assigned from compat classification

Version classification

The classification field in every version tells you what changed:

  • initial — First version of the spec
  • major — Breaking changes detected
  • minor — Safe additions detected
  • patch — No API surface change (descriptions, examples only)

You can see this in the Hub under the Compat tab for any version.

See also

Released under the Apache 2.0 License.