Skip to main content

Breaking changes across formats

When you compare two versions, Apiome grades every change Safe, Dangerous or Breaking, whatever the format. Only the rules behind the grade differ. An OpenAPI change breaks a client calling the API. For an event schema or a Protobuf message, it depends on who reads and who writes, so Apiome grades those changes the way each format's own tools do. It reads them under a compatibility mode (BACKWARD, FORWARD, FULL or NONE), and reads Protobuf under a Buf category.

The rules themselves, the mode settings and the full rule catalogue are on Compatibility modes. This page shows how the parts fit together.

When to use it​

  • Your Kafka topics have a schema registry. Grade Avro and JSON Schema changes under the same mode as the registry's subject, so the diff and the registry agree on what is safe.
  • Your gRPC services are checked with buf breaking. Grade Protobuf changes under the same category your Buf config uses, such as WIRE_JSON or FILE.
  • Your events have producers and consumers that upgrade at different times. Grade AsyncAPI channels for the side that upgrades first.
  • A pull request must not break a data contract. Gate it in CI with apiome diff --mode, the same way you gate an OpenAPI change.

How each format is graded​

FormatGraded byDefaultChecked againstDetails
AvroAvro schema resolution, as a Confluent registry applies itBACKWARDApicurio Registry and recorded Confluent answersAvro import
JSON SchemaThe open, closed and partially open content modelsBACKWARDApicurio Registry and recorded Confluent answersJSON Schema
ProtobufBuf's four categories: WIRE, WIRE_JSON, PACKAGE, FILEWIRE_JSONbuf breakingProtobuf
AsyncAPI 2 and 3Channel and operation rules for consumers and producers; payloads by their own formatBACKWARD@asyncapi/diffAsyncAPI
GraphQLGraphQL-Inspector where the server runs it, otherwise the structural rulesNo modesGraphQL-InspectorKnown differences
OpenAPI and othersThe OpenAPI change taxonomy, or the format's own rulesNo modes—Contract testing and CI gates

Under the default BACKWARD, a change that fails BACKWARD is Breaking. A change that passes BACKWARD but fails FORWARD is Dangerous. A change that passes both is Safe. Each grade's explanation starts with the mode or category it was graded under, such as [FORWARD] or [WIRE_JSON].

Choose the mode​

  1. Set the project's default. A style guide's policy holds compatibilityMode, compatibilityTransitive and protobufBreakingCategory. The project gets them from the guide it is assigned, the way it gets every other guide setting. The Style guides screen is not yet available, so set them over the REST API. See Choose a project's mode.
  2. Override it for one check. Pass mode, transitive or category in the request, or --mode, --transitive or --category on the CLI. See Ask for a mode in one request.
  3. Check every earlier version, not only the last one. Turn on transitive, or use a _TRANSITIVE mode such as FULL_TRANSITIVE. A change that breaks an earlier version names that version. See Transitive checks.
apiome diff ./orders.avsc --against orders-events@latest --mode full --transitive --fail-on breaking

Where the grades show​

WhereWhat you seeDetails
What changed on a catalog item's Versions tab, and the change list when a file is re-importedEach change's grade, with the mode or category in brackets in WhyCatalog refresh
The classified diff and apiome diffEvery change with its ruleId, grade and rationalePOST /v1/diff/{tenant}/classified, apiome diff
The compatibility check and apiome compat --modeA verdict for two versions of a projectPOST …/compatibility, apiome compat
CIThe diff gate uses the project's mode unless the workflow sets modeCI diff gate, diff-action
PublishingThe breaking-publish guardrail grades the new version by the project's modeStop a breaking publish
The rule catalogueEvery rule id, with its grade under each mode or categoryGET /v1/compatibility/rules

Every response says what it evaluated in evaluatedUnder, including the mode, category and ruleset, and whether each one came from the request or from the policy. When a format has no modes, such as OpenAPI, modeApplied is false and ruleset names what graded the changes instead.

Why you can trust the grades​

A test corpus of version pairs for each format records Apiome's verdict under every mode. Every pull request that changes a classifier runs that corpus against the live reference tools: an Apicurio Registry, buf breaking, @asyncapi/diff and GraphQL-Inspector. When Apiome and a tool disagree, the build fails. The only exception is a listed difference, which comes with the reason Apiome grades the change its own way. Removing a Protobuf reservation is one example: Apiome grades it Dangerous, and Buf grades it breaking. Every listed difference is in Known differences from reference tools.

How the pieces fit​

  • One grade, every format. Each classifier answers Safe, Dangerous or Breaking, so --fail-on breaking and the publish guardrail work the same way for an Avro schema as for an OpenAPI file.
  • One setting, every surface. The diff, the compatibility check, the CLI, the CI gate and the publish guardrail all read the same policy. A change graded breaking in CI is also graded breaking at publish.
  • Every change names its rule. Each change carries a ruleId, and the rule catalogue lists every one with its grade under each mode, so a CI failure can be looked up in one step.
  • The schema registry is separate. A registry subject's compatibility level checks Avro schemas when they are registered. See The schema registry.