Skip to main content

Compatibility modes

When you compare two versions of a catalog item, Apiome grades every change Safe, Dangerous or Breaking. For data-schema formats, whether a change breaks anyone depends on who reads and who writes. Schema registries such as Confluent and Apicurio call that the compatibility mode:

ModeA change passes when…Who is protected
BACKWARDthe new schema accepts every value the old one didNew readers of data old writers wrote
FORWARDthe old schema accepts every value the new one doesOld readers of data new writers write
FULLboth of the aboveBoth

The _TRANSITIVE forms (BACKWARD_TRANSITIVE, FORWARD_TRANSITIVE, FULL_TRANSITIVE) apply the same check against every earlier version, not only the latest. For one pair of versions, they check the same thing as the plain form.

NONE turns compatibility checking off: changes are still listed with their rule ids, but none of them fails. Changes are graded against BACKWARD, a Confluent registry's default, unless the project's policy or the request names another mode (see Choose a project's mode):

A change…Severity
fails BACKWARDBreaking
passes BACKWARD but fails FORWARDDangerous
passes FULLSafe

Each grade's explanation starts with the mode it was graded under, such as [FORWARD], then names the modes the change breaks. Avro grades under the default BACKWARD keep their explanation without the bracket.

Formats graded by mode​

FormatHow it is checkedDetails
AvroAvro schema resolution, the way a Confluent registry applies itCompatibility between versions
JSON SchemaThe open and closed content models, the way Confluent and Apicurio apply themJSON Schema on this page
ProtobufBuf's four breaking-change categories instead of modesProtobuf on this page
AsyncAPI 2 and 3Channel and operation rules graded for consumers and producers, read by mode; payloads by their own formatAsyncAPI on this page

Other formats keep their own rules, such as GraphQL-Inspector for GraphQL, and the built-in ruleset where a format has none.

JSON Schema​

Open and closed content models​

Whether adding or removing a property is safe depends on the object's content model:

  • Open: additionalProperties is absent or true. The object may carry any property it does not declare.
  • Closed: additionalProperties: false, or unevaluatedProperties: false. The object may carry only the properties it declares.
  • Partially open: additionalProperties is a schema. Undeclared properties must match it.

The same change can therefore get opposite verdicts. In a closed model, old data cannot carry a property that was never declared, so adding one is backward compatible. Old readers still reject it, so it fails FORWARD. In an open model, old data may already carry that name with any value. Declaring it narrows what new readers accept, so adding one fails BACKWARD. The grade's explanation names the content model it used.

The rules​

ChangeBreaksSeverityRule id
Property added to a closed modelFORWARD, FULLDangerousjsonschema.forward.closed-property-added
Property removed from a closed modelBACKWARD, FULLBreakingjsonschema.backward.closed-property-removed
Property added to an open modelBACKWARD, FULLBreakingjsonschema.backward.open-property-added
Property removed from an open modelFORWARD, FULLDangerousjsonschema.forward.open-property-removed
additionalProperties open → closedBACKWARD, FULLBreakingjsonschema.backward.additional-properties-closed
additionalProperties closed → openFORWARD, FULLDangerousjsonschema.forward.additional-properties-opened
A property becomes requiredBACKWARD, FULLBreakingjsonschema.backward.required-added
A property is no longer requiredFORWARD, FULLDangerousjsonschema.forward.required-removed
An enum or const value removed, or an enum addedBACKWARD, FULLBreakingjsonschema.backward.enum-narrowed
An enum value added, or the enum removedFORWARD, FULLDangerousjsonschema.forward.enum-widened
type widened: integer → number, or null allowedFORWARD, FULLDangerousjsonschema.forward.type-widened
type narrowed: number → integerBACKWARD, FULLBreakingjsonschema.backward.type-narrowed
type replaced: integer → stringAll threeBreakingjsonschema.backward.type-changed
A oneOf / anyOf branch removedBACKWARD, FULLBreakingjsonschema.backward.one-of-branch-removed
A oneOf / anyOf branch addedFORWARD, FULLDangerousjsonschema.forward.any-of-branch-added
A bound tightened: maximum, maxLength, minLength, maxItems…BACKWARD, FULLBreakingjsonschema.backward.max-length-tightened
A bound loosened or removedFORWARD, FULLDangerousjsonschema.forward.maximum-loosened
A pattern, format or multipleOf addedBACKWARD, FULLBreakingjsonschema.backward.pattern-tightened
A pattern, format or multipleOf replacedAll threeBreakingjsonschema.backward.pattern-changed
uniqueItems turned onBACKWARD, FULLBreakingjsonschema.backward.unique-items-tightened

Rule ids follow jsonschema.<direction>.<rule>. The direction is backward when the new schema rejects old data and forward when the old schema rejects new data. Bound rules name their keyword, such as minimum-tightened or max-items-loosened, and the oneOf and anyOf rules name theirs (one-of-branch-added, any-of-branch-removed).

A property added to a partially open model is checked against the old additionalProperties schema. If that schema already allowed the value, the addition is safe.

What is not graded​

  • Annotations. title, description, default, examples, deprecated, readOnly, writeOnly and $comment never change which data is valid, so editing them is safe.
  • Keywords the check does not model. not, if / then / else, patternProperties, propertyNames, dependentRequired, dependentSchemas, contains and prefixItems are compared as written. A change to one is Dangerous under every mode with jsonschema.review.unmodeled-keyword-changed, and never fails a mode on its own.
  • A $ref outside the document. A change to a reference such as https://example.com/address.json is flagged jsonschema.review.ref-changed.

$ref​

Local references (#/$defs/Address) are resolved inside each version before comparing. When both versions point at the same definition, the definition is compared once, on its own type, so a change to Address is reported on Address and not again on every property that uses it. When a property's $ref now points at a different definition, the two targets are compared and the result is reported on that property. Self-referencing definitions are supported.

Where the results show​

The grades appear wherever Apiome grades a JSON Schema catalog item's changes. That includes drift, under What changed on the item's Versions tab (see Catalog refresh), and the change list when you re-import a file over an existing item. The classifier is named jsonschema-compatibility.

Each grade joins the change it belongs to: a property's grade joins that property's change, and any other grade joins its type's change. Some changes have no row of their own, such as an additionalProperties flip or a property inside a nested object. They are still graded, and they count toward the overall grade, so a breaking one is never missed.

Protobuf​

Protobuf has no reader and writer modes. Buf instead sorts breaking changes into four categories, from least to most strict. Each one includes everything the one above it checks:

CategoryProtectsBreaks when…
WIREBinary-encoded messagesThe bytes no longer decode the same way, such as a field number now carrying another type
WIRE_JSONBinary and JSON-encoded messagesWIRE, or a JSON key changes, such as a renamed field or a new json_name
PACKAGECode generated for a packageWIRE_JSON, or a declaration is deleted, renamed or changes label
FILECode generated per filePACKAGE, or a declaration moves to another file

Changes are graded under WIRE_JSON by default, because gRPC services carry both binary and JSON (transcoded) traffic. A change is Breaking when it breaks the category, otherwise the severity in the table below.

Each grade's explanation starts with the category it was graded under, such as [WIRE_JSON]. A Protobuf rule's explanation also lists its grade under all four, so you can see that a change is safe on the wire but breaks generated code:

[WIRE_JSON] acme.v1.User.user_name: json_name changed 'userName' → 'login'
(breaking under WIRE_JSON, PACKAGE, FILE; safe under WIRE)

The Protobuf rules​

ChangeWIREWIRE_JSONPACKAGEFILERule id
A reserved number or name removedDangerousDangerousDangerousDangerousprotobuf.wire.reserved-removed
A reserved number used againBreakingBreakingBreakingBreakingprotobuf.wire.reserved-number-reused
A reserved name used againBreakingBreakingBreakingBreakingprotobuf.wire.reserved-name-reused
A field deleted, number not reservedDangerousBreakingBreakingBreakingprotobuf.wire_json.field-deleted-unreserved
A field deleted, number reserved but name notSafeBreakingBreakingBreakingprotobuf.wire_json.field-deleted-unreserved
A field deleted, number and name reservedSafeSafeBreakingBreakingprotobuf.package.field-deleted
A field renamed, same number and typeSafeBreakingBreakingBreakingprotobuf.wire_json.field-renamed
A field number now carrying another typeBreakingBreakingBreakingBreakingprotobuf.wire.field-number-reused
json_name changedSafeBreakingBreakingBreakingprotobuf.wire_json.json-name-changed
A message or enum moved to another file in the same packageSafeSafeSafeBreakingprotobuf.file.type-moved-file
A message or enum moved to another packageBreakingBreakingBreakingBreakingprotobuf.wire.package-changed
An enum value renamed (its number taken by a new name)SafeBreakingBreakingBreakingprotobuf.wire_json.enum-value-number-reused
An enum value moved to another numberBreakingBreakingBreakingBreakingprotobuf.wire.enum-value-number-changed
A field moved into, out of or between oneofsBreakingBreakingBreakingBreakingprotobuf.wire.oneof-membership-changed
A field made repeated, or no longer repeatedBreakingBreakingBreakingBreakingprotobuf.wire.cardinality-changed
A field made required, or no longer requiredBreakingBreakingBreakingBreakingprotobuf.wire.required-changed
optional added to or removed from a proto3 fieldSafeSafeBreakingBreakingprotobuf.package.presence-changed
A number or name reservedSafeSafeSafeSafeprotobuf.compatible

Rule ids follow protobuf.<category>.<rule>. The category is the least strict one where the rule reaches its worst severity, so protobuf.wire_json.json-name-changed is safe under WIRE and breaking from WIRE_JSON up.

Changes these rules do not cover keep the built-in grade under every category, such as a field's type changing (Breaking) or a field being added (Safe).

Where Apiome differs from Buf​

The grades follow Buf's rules in all but two places, where Apiome is deliberately softer:

  • Removing a reservation is Dangerous, not breaking. Nothing breaks until a later change reuses the number or name, and that reuse is graded Breaking.
  • Deleting a field whose number is not reserved is Dangerous under WIRE, not breaking. The bytes old writers send are skipped as an unknown field. Under WIRE_JSON and above it is Breaking, as in Buf.

With buf installed​

When the server has buf and both versions' .proto sources, it also runs buf breaking under the same category and uses its verdict for the overall grade:

  • If buf finds a break, each buf finding is listed too, under rule ids such as protobuf.buf-breaking.field_same_json_name, and the overall grade is Breaking.
  • If buf finds none, every Breaking grade is lowered to Dangerous, with rule id buf-breaking.wire-compatible.

When buf and the rules above disagree about whether the change breaks, the explanation says disagreement: and names the rules on each side. Without buf, the rules above grade on their own.

Where the Protobuf results show​

The grades appear wherever Apiome grades a Protobuf or gRPC catalog item's changes. That includes drift, under What changed on the item's Versions tab (see Catalog refresh), and the change list when you re-import a file over an existing item. The Why column starts with the category in brackets. The classifier is named buf-breaking.

A message or enum moved to another file has no row of its own, because the file a declaration sits in is not part of the version comparison. It is still graded under FILE, and it counts toward the overall grade.

AsyncAPI​

An event channel has two sides, and a change can break one and not the other. Apiome grades every AsyncAPI channel, operation and message change for each side:

SideWho upgrades firstThe mode that checks it
ConsumersNew consumers, while old producers keep sendingBACKWARD
ProducersNew producers, while old consumers keep readingFORWARD

FULL checks both sides. Changes are graded under BACKWARD by default. A side the mode checks keeps its grade. A side it does not check drops one step: a break there is Dangerous, and a Dangerous grade there is Safe. So adding a message is Safe under BACKWARD, because new consumers already handle it, but Dangerous under FORWARD, because old consumers must handle it once producers send it.

Each grade's explanation starts with the mode and what it checks, and ends with both sides' grades:

[BACKWARD: new consumers against old producers] message 'onOrder#event.OrderCancelled' removed
from the operation's messages; new consumers break on it while old producers still send it
(consumers: breaking, producers: safe)

The AsyncAPI rules​

ChangeConsumersProducersBACKWARDFORWARDFULLRule id
A channel's address or address template changedBreakingDangerousBreakingDangerousBreakingasyncapi.consumer.address-changed
An address parameter added without a defaultBreakingDangerousBreakingDangerousBreakingasyncapi.consumer.parameter-added
An address parameter added with a defaultSafeSafeSafeSafeSafeasyncapi.both.parameter-added-with-default
A server's protocol changedBreakingBreakingBreakingBreakingBreakingasyncapi.both.protocol-changed
A channel, operation, message or server binding changedBreakingBreakingBreakingBreakingBreakingasyncapi.both.binding-changed
An operation's action flipped between send and receive (publish and subscribe in 2.x)BreakingBreakingBreakingBreakingBreakingasyncapi.both.action-flipped
An operation's reply removed (3.x)BreakingDangerousBreakingDangerousBreakingasyncapi.consumer.reply-removed
A message removed from a channel's messages (oneOf in 2.x)BreakingSafeBreakingDangerousBreakingasyncapi.consumer.message-removed
A message added to a channel's messagesSafeDangerousSafeDangerousDangerousasyncapi.producer.message-added
A payload's schemaFormat changed to another schema languageBreakingBreakingBreakingBreakingBreakingasyncapi.both.schema-format-changed
A payload changed in a way its own format accepts both waysSafeSafeSafeSafeSafeasyncapi.both.payload-compatible
A server added, removed or movedDangerousDangerousDangerousDangerousDangerousasyncapi.both.server-changed
A server's or an operation's security changedDangerousDangerousDangerousDangerousDangerousasyncapi.both.security-changed

Rule ids follow asyncapi.<side>.<rule>. The side is the one the change is worst for: consumer, producer, or both when the two sides grade alike. Requesters consume the reply, so a removed reply is graded on the consumer side. AsyncAPI 2 has no reply, so that rule applies to 3.x only.

A message counts as removed or added only when its operation exists in both versions. When a whole operation is removed or added, its messages keep the built-in grade, and so does any other change these rules do not cover, such as removing a whole channel (Breaking) or changing a message's headers (Dangerous).

When an address or action changes​

A channel is identified by its address, so a new address first looks like one channel removed and another added. Apiome treats them as one channel with a new address when the channel keeps its name (AsyncAPI 3), or when an operation in both versions moved from one to the other. Both rows, and the operation's row, are then graded address-changed.

In AsyncAPI 2 an operation without an operationId is identified by its action and address, so flipping subscribe to publish looks like one operation removed and another added. When both are on the same channel, both rows are graded action-flipped.

Payloads​

A payload is graded by the check of its own schema language, named by schemaFormat. In AsyncAPI 3 that is the payload's schemaFormat and schema; in AsyncAPI 2 it is the message's schemaFormat and payload:

schemaFormatChecked byRule ids
None, application/vnd.aai.asyncapi, application/schema+json or +yamlThe JSON Schema rulesjsonschema.*
application/vnd.apache.avro (+json, +yaml)Avro schema resolution, both waysavro-compatibility.*
application/vnd.google.protobuf, application/x-protobufThe Protobuf rules under WIRE_JSONprotobuf.*
Anything else, such as RAML or the OpenAPI Schema ObjectNot checked: the built-in grade stands—

So an Avro payload that gains a field without a default reports avro-compatibility.reader-field-missing-default-value: Breaking for consumers, because new consumers cannot read what old producers wrote, and Safe for producers. A problem the new schema finds in old data is a consumer-side break; a problem the old schema finds in new data is a producer-side break. Protobuf's rules grade both sides alike.

Only the media type counts as the schema language. application/vnd.apache.avro;version=1.9.0 and …;version=1.11.0 are the same language. A Protobuf payload is checked only when the server has buf to compile it; otherwise the built-in grade stands.

With @asyncapi/diff installed​

When the server has the asyncapi-diff tool, it also runs @asyncapi/diff over the two documents. Its verdict replaces the grade of each whole channel or operation it classifies, with rule id asyncapi-diff.breaking or asyncapi-diff.non-breaking. Every other change keeps the grades above.

Where the AsyncAPI results show​

The grades appear wherever Apiome grades an AsyncAPI catalog item's changes. That includes drift, under What changed on the item's Versions tab (see Catalog refresh), and the change list when you re-import a file over an existing item. The rule id names the side and the Why column starts with the mode in brackets. The classifier is named asyncapi-diff.

Servers have no row of their own in the version comparison, and neither does a .proto text payload in AsyncAPI 2. Their findings are still graded, and they count toward the overall grade.

Choose a project's mode​

A project's mode is part of its style guide's policy. Go to Govern → Style guides, open the guide, choose the Policy tab and set Compatibility mode, Check every earlier version and Protobuf breaking category under Compatibility, then click “Save”. Over the REST API, the same three settings are PUT /v1/style-guides/{tenant}/{guide}/policy:

PUT /v1/style-guides/{tenant}/{guide}/policy
X-API-Key: <your-api-key>

{ "compatibilityMode": "FULL", "compatibilityTransitive": true, "protobufBreakingCategory": "WIRE_JSON" }

A field you leave out keeps its value:

FieldValuesDefault
compatibilityModeBACKWARD, FORWARD, FULL, NONEBACKWARD
compatibilityTransitivetrue checks every earlier version toofalse
protobufBreakingCategoryWIRE, WIRE_JSON, PACKAGE, FILEWIRE_JSON

GET on the same path reads them back.

The policy resolves the way every guide setting does: a guide assigned to the project wins over one assigned to the workspace, which wins over the workspace's default guide. It applies to:

Every guide edit records the three settings in the guide's history, so a past verdict can be explained by the policy it ran under.

Ask for a mode in one request​

The classified diff and the compatibility check both accept mode, transitive and category in the request body. Anything you leave out comes from the project's policy:

{
"base": { "project": "orders-events", "version": "3.0.0" },
"head": { "project": "orders-events", "version": "3.1.0" },
"mode": "FULL_TRANSITIVE"
}

A _TRANSITIVE mode name also turns on transitive. From the CLI:

apiome diff ./orders.avsc --against orders-events@latest --mode forward
apiome diff ./orders.avsc --against orders-events@latest --mode full --transitive
apiome compat --project orders-events --base-version 3.0.0 --version 3.1.0 --mode full

What a response says it evaluated​

Every response carries evaluatedUnder:

"evaluatedUnder": {
"mode": "FORWARD",
"transitive": false,
"category": null,
"formats": ["avro"],
"modeApplied": true,
"categoryApplied": false,
"ruleset": "avro-compatibility",
"source": { "mode": "request", "transitive": "policy", "category": "policy" },
"comparedRevisions": [{ "revisionId": "…", "versionLabel": "3.0.0", "role": "base" }],
"comparedRevisionsTruncated": false
}
  • modeApplied is true only when an Avro, JSON Schema or AsyncAPI classifier graded the changes by mode. For a format without one, such as OpenAPI, RAML, API Blueprint or WSDL, it is false and ruleset names what graded the changes instead: ctg for the OpenAPI change taxonomy, openapi-compatibility for the compatibility check's OpenAPI engine, or the format's own classifier. The response never implies a mode it did not apply.
  • category is set, and categoryApplied is true, only when Protobuf was compared.
  • source says whether each setting came from the request or from the project's policy.

Each change also carries its ruleId. In the classified diff, a change graded by one of these classifiers also carries grade (safe, dangerous or breaking) and rationale. Its severity is breaking for a break and non-breaking otherwise, so --fail-on warn fails on both dangerous and safe changes, as it does for OpenAPI.

Transitive checks​

With transitive on, the head is compared with the base and then with every earlier revision of the base, newest first, up to 50. The earlier revisions are the base's published ancestors. For a catalog item, which is never published, they are the item's earlier revisions.

Every change against the base is listed. From an earlier revision, only breaking changes are added, and only ones no newer revision already reported. Each change then names the revision it was found against:

{
"ruleId": "avro-compatibility.reader-field-missing-default-value",
"severity": "breaking",
"against": { "revisionId": "…", "versionLabel": "1.0.0" }
}

A change can therefore be compatible with the base and still fail. When the publish guardrail finds one, its message names the earlier version, for example 1 breaking change(s) versus 2.0.0 published as 2.1.0 (breaking against earlier revision(s) 1.0.0). Under a block policy that publish is refused.

Which documents are compared​

When a comparison uses OpenAPI (every format without a mode-aware classifier), each stored side is the version's OpenAPI document from the document store. This applies to the classified diff, the compatibility check, a merge request's or review's Changes tab, the published version's changelog and every earlier revision a transitive check reads.

  • The first comparison of a version, or the first one after it was edited, generates the document and stores it. Later comparisons read the stored copy, so a large version is compared quickly.
  • When both sides are the same document, the comparison reports no changes straight away.
  • The graded changes are the same either way.
  • In the app, a wait that runs long while a document is generated says Rendering the documents for the first time.

Formats graded by mode are compared as canonical models, rebuilt from each version's imported file. Apiome keeps recently rebuilt models in memory (the parsed-model cache).

To see whether a comparison read stored documents, look at the X-Apiome-Document-Cache response header of POST /v1/diff/{tenant}/classified or POST /v1/versions/{tenant}/{project}/compatibility:

curl -s -D - -o /dev/null -X POST https://api.example.com/v1/diff/acme/classified \
-H "X-API-Key: $APIOME_API_KEY" -H 'Content-Type: application/json' \
-d '{"base": {"project": "payments-api", "version": "2.0.0"},
"head": {"project": "payments-api", "version": "2.1.0"}}' | grep -i x-apiome-document-cache
# x-apiome-document-cache: base=hit, head=miss
ValueMeaning
hitThe side was read from the store.
missThis request generated the side. The next comparison reads it from the store.

base and head are listed for each comparison. A transitive check also lists prior, which is miss when any earlier revision had to be generated. An inline head (an uploaded file) is not listed. The header is not sent when the sides were compared as canonical models.

Known differences from reference tools​

Apiome checks its grades against the tools each format's teams already run. A test corpus of version pairs per format records Apiome's verdict under every mode, alongside each reference tool's verdict on the same pair:

FormatReference toolCompared under
Avro, JSON SchemaApicurio Registry (its Confluent-compatible API) and recorded Confluent Schema Registry answersBACKWARD, FORWARD, FULL, NONE
Protobufbuf breakingWIRE, WIRE_JSON, PACKAGE, FILE
AsyncAPI@asyncapi/diffBACKWARD (the tool has no modes)
GraphQLGraphQL-InspectorThe default grade (GraphQL has no modes)

The Avro cases include the rows of Confluent's compatibility-types table (add or delete a field, with or without a default). The JSON Schema cases include Confluent's open, closed and partially open content-model rules. The Protobuf cases fire every Protobuf rule in the rule catalogue.

Every pull request that changes a classifier runs the corpus against live reference tools. If Apiome and a tool disagree about whether a change is compatible, the build fails. The only exceptions are the differences listed below, each with the reason Apiome grades it its own way. Modes lists the modes, or Protobuf categories, where the two verdicts differ. The corpus and its generated README are in apiome-rest/tests/golden/compatibility/.

CaseReference toolModesWhy Apiome differs
protobuf/reserved-removedbuf breakingFILE, PACKAGE, WIRE, WIRE_JSONXPC-4.3 decision: removing a reservation is Dangerous, not breaking. Nothing breaks until a later change reuses the number or name, and that reuse is graded Breaking.
protobuf/field-deleted-unreservedbuf breakingWIREXPC-4.3 decision: under WIRE, deleting a field whose number is not reserved is Dangerous. The bytes old writers send are skipped as an unknown field; from WIRE_JSON up it is Breaking, as in Buf.
asyncapi/v2-server-changed@asyncapi/diff (standard ruleset)BACKWARDXPC-4.4 decision: a server added, removed or moved is Dangerous on both sides. It changes where clients connect, not the messages they exchange; @asyncapi/diff calls a host edit breaking.
asyncapi/v3-server-changed@asyncapi/diff (standard ruleset)BACKWARDXPC-4.4 decision: a server added, removed or moved is Dangerous on both sides. It changes where clients connect, not the messages they exchange; @asyncapi/diff calls a host edit breaking.
asyncapi/v2-security-changed@asyncapi/diff (standard ruleset)BACKWARDXPC-4.4 decision: a server's or an operation's security change is Dangerous on both sides. Clients need new credentials, but the contract's messages are unchanged.
asyncapi/v3-security-changed@asyncapi/diff (standard ruleset)BACKWARDXPC-4.4 decision: a server's or an operation's security change is Dangerous on both sides. Clients need new credentials, but the contract's messages are unchanged.
asyncapi/v2-parameter-added@asyncapi/diff (standard ruleset)BACKWARDXPC-4.4 decision: an address parameter added without a default is Breaking for consumers, who cannot build the new address; @asyncapi/diff calls any parameter addition non-breaking.
json-schema/array-items-narrowedApicurio Registry (ccompat API)FORWARDApicurio fails both directions when a type list narrows. Every value the new schema accepts the old one accepts too, so old readers still read new data: Apiome fails BACKWARD only.
json-schema/partially-open-property-added-narrowerApicurio Registry (ccompat API)FORWARDApicurio fails both directions when a type list narrows. Every value the new schema accepts the old one accepts too, so old readers still read new data: Apiome fails BACKWARD only.
json-schema/ref-cycleApicurio Registry (ccompat API)BACKWARD, FULLApiome grades every $defs entry as a type of its own; a registry checks only the root schema, so a change to a definition the root never references passes there.
json-schema/ref-target-movedApicurio Registry (ccompat API)BACKWARD, FULLApiome grades every $defs entry as a type of its own; a registry checks only the root schema, so a change to a definition the root never references passes there.
json-schema/ref-shared-definitionApicurio Registry (ccompat API)FORWARD, FULLApiome grades every $defs entry as a type of its own; a registry checks only the root schema, so a change to a definition the root never references passes there.
graphql/enum-value-removedGraphQL-Inspector (@graphql-inspector/core)DEFAULTThe compatibility API grades GraphQL with the format-agnostic structural rules; GraphQL-Inspector's verdict replaces them only where the server runs it. The structural rules grade a removed enum value as a Dangerous type change.
graphql/output-field-made-nullableGraphQL-Inspector (@graphql-inspector/core)DEFAULTThe compatibility API grades GraphQL with the format-agnostic structural rules; GraphQL-Inspector's verdict replaces them only where the server runs it. They do not read nullability by direction, so an output field made nullable is graded Safe.
graphql/output-field-made-non-nullGraphQL-Inspector (@graphql-inspector/core)DEFAULTThe compatibility API grades GraphQL with the format-agnostic structural rules; GraphQL-Inspector's verdict replaces them only where the server runs it. They do not read nullability by direction, so an output field made non-null is graded Breaking.
graphql/required-argument-addedGraphQL-Inspector (@graphql-inspector/core)DEFAULTThe compatibility API grades GraphQL with the format-agnostic structural rules; GraphQL-Inspector's verdict replaces them only where the server runs it. They grade a new required argument as a Dangerous field change.
graphql/required-input-field-addedGraphQL-Inspector (@graphql-inspector/core)DEFAULTThe compatibility API grades GraphQL with the format-agnostic structural rules; GraphQL-Inspector's verdict replaces them only where the server runs it. They grade a new required input field as Dangerous (added-mandatory-field).

Rule catalogue​

GET /v1/compatibility/rules lists every rule id these classifiers report, with its severity under each mode or Protobuf category. Add ?format=avro (or json-schema, protobuf, asyncapi, or a format key such as asyncapi-3) to list one format's rules. API keys with diff:read or registry:read can read it. The tables below are generated from the same data.

Breaks is the side a rule protects: backward (the new schema rejects old data), forward (the old schema rejects new data), review (a change the check cannot prove either way), or either for an Avro rule, which is breaking under the modes that check the direction it was found in. AsyncAPI rules name consumer, producer or both. A rule id ending in * is a family: the rest of the id is the tool's own rule name.

Avro rules​

Rule idBreaksBACKWARDFORWARDFULLNONEDescription
avro-compatibility.compatible—SafeSafeSafeSafeAvro schema resolution reads the change both ways (FULL compatible).
avro-compatibility.fixed-size-mismatcheitherBreakingBreakingBreakingDangerousA fixed of another size.
avro-compatibility.missing-enum-symbolseitherBreakingBreakingBreakingDangerousWriter enum symbols the reader lacks, and the reader's enum has no default.
avro-compatibility.missing-union-brancheitherBreakingBreakingBreakingDangerousA writer union branch no reader branch can read.
avro-compatibility.name-mismatcheitherBreakingBreakingBreakingDangerousA record, enum or fixed renamed without an alias for the old name.
avro-compatibility.reader-field-missing-default-valueeitherBreakingBreakingBreakingDangerousA reader field the writer lacks has no default.
avro-compatibility.type-mismatcheitherBreakingBreakingBreakingDangerousTwo types that do not resolve; Avro's promotions such as int to long do.

JSON Schema rules​

Rule idBreaksBACKWARDFORWARDFULLNONEDescription
jsonschema.backward.additional-properties-closedbackwardBreakingDangerousBreakingDangerousadditionalProperties turned from open to closed.
jsonschema.backward.any-of-branch-removedbackwardBreakingDangerousBreakingDangerousAn anyOf branch removed.
jsonschema.backward.closed-property-removedbackwardBreakingDangerousBreakingDangerousA property removed from a closed content model.
jsonschema.backward.enum-narrowedbackwardBreakingDangerousBreakingDangerousAn enum or const value removed, or an enum added.
jsonschema.backward.exclusive-maximum-tightenedbackwardBreakingDangerousBreakingDangerousThe exclusiveMaximum bound tightened or added.
jsonschema.backward.exclusive-minimum-tightenedbackwardBreakingDangerousBreakingDangerousThe exclusiveMinimum bound tightened or added.
jsonschema.backward.format-changedbackwardBreakingDangerousBreakingDangerousA format replaced by another.
jsonschema.backward.format-tightenedbackwardBreakingDangerousBreakingDangerousA format added.
jsonschema.backward.max-items-tightenedbackwardBreakingDangerousBreakingDangerousThe maxItems bound tightened or added.
jsonschema.backward.max-length-tightenedbackwardBreakingDangerousBreakingDangerousThe maxLength bound tightened or added.
jsonschema.backward.max-properties-tightenedbackwardBreakingDangerousBreakingDangerousThe maxProperties bound tightened or added.
jsonschema.backward.maximum-tightenedbackwardBreakingDangerousBreakingDangerousThe maximum bound tightened or added.
jsonschema.backward.min-items-tightenedbackwardBreakingDangerousBreakingDangerousThe minItems bound tightened or added.
jsonschema.backward.min-length-tightenedbackwardBreakingDangerousBreakingDangerousThe minLength bound tightened or added.
jsonschema.backward.min-properties-tightenedbackwardBreakingDangerousBreakingDangerousThe minProperties bound tightened or added.
jsonschema.backward.minimum-tightenedbackwardBreakingDangerousBreakingDangerousThe minimum bound tightened or added.
jsonschema.backward.multiple-of-changedbackwardBreakingDangerousBreakingDangerousA multipleOf replaced by another.
jsonschema.backward.multiple-of-tightenedbackwardBreakingDangerousBreakingDangerousA multipleOf added.
jsonschema.backward.one-of-branch-removedbackwardBreakingDangerousBreakingDangerousA oneOf branch removed.
jsonschema.backward.open-property-addedbackwardBreakingDangerousBreakingDangerousA property added to an open content model.
jsonschema.backward.pattern-changedbackwardBreakingDangerousBreakingDangerousA pattern replaced by another.
jsonschema.backward.pattern-tightenedbackwardBreakingDangerousBreakingDangerousA pattern added.
jsonschema.backward.required-addedbackwardBreakingDangerousBreakingDangerousA property became required.
jsonschema.backward.schema-rejects-allbackwardBreakingDangerousBreakingDangerousThe schema became false and now rejects every value.
jsonschema.backward.type-changedbackwardBreakingDangerousBreakingDangerousA type replaced by an unrelated one, such as integer to string.
jsonschema.backward.type-narrowedbackwardBreakingDangerousBreakingDangerousA type narrowed, such as number to integer.
jsonschema.backward.unique-items-tightenedbackwardBreakingDangerousBreakingDangerousuniqueItems turned on.
jsonschema.compatible—SafeSafeSafeSafeThe JSON Schema check accepts the change both ways (FULL compatible).
jsonschema.forward.additional-properties-openedforwardDangerousBreakingBreakingDangerousadditionalProperties turned from closed to open.
jsonschema.forward.any-of-branch-addedforwardDangerousBreakingBreakingDangerousAn anyOf branch added.
jsonschema.forward.closed-property-addedforwardDangerousBreakingBreakingDangerousA property added to a closed content model.
jsonschema.forward.enum-widenedforwardDangerousBreakingBreakingDangerousAn enum value added, or the enum removed.
jsonschema.forward.exclusive-maximum-loosenedforwardDangerousBreakingBreakingDangerousThe exclusiveMaximum bound loosened or removed.
jsonschema.forward.exclusive-minimum-loosenedforwardDangerousBreakingBreakingDangerousThe exclusiveMinimum bound loosened or removed.
jsonschema.forward.format-changedforwardDangerousBreakingBreakingDangerousA format replaced by another.
jsonschema.forward.format-loosenedforwardDangerousBreakingBreakingDangerousA format removed.
jsonschema.forward.max-items-loosenedforwardDangerousBreakingBreakingDangerousThe maxItems bound loosened or removed.
jsonschema.forward.max-length-loosenedforwardDangerousBreakingBreakingDangerousThe maxLength bound loosened or removed.
jsonschema.forward.max-properties-loosenedforwardDangerousBreakingBreakingDangerousThe maxProperties bound loosened or removed.
jsonschema.forward.maximum-loosenedforwardDangerousBreakingBreakingDangerousThe maximum bound loosened or removed.
jsonschema.forward.min-items-loosenedforwardDangerousBreakingBreakingDangerousThe minItems bound loosened or removed.
jsonschema.forward.min-length-loosenedforwardDangerousBreakingBreakingDangerousThe minLength bound loosened or removed.
jsonschema.forward.min-properties-loosenedforwardDangerousBreakingBreakingDangerousThe minProperties bound loosened or removed.
jsonschema.forward.minimum-loosenedforwardDangerousBreakingBreakingDangerousThe minimum bound loosened or removed.
jsonschema.forward.multiple-of-changedforwardDangerousBreakingBreakingDangerousA multipleOf replaced by another.
jsonschema.forward.multiple-of-loosenedforwardDangerousBreakingBreakingDangerousA multipleOf removed.
jsonschema.forward.one-of-branch-addedforwardDangerousBreakingBreakingDangerousA oneOf branch added.
jsonschema.forward.open-property-removedforwardDangerousBreakingBreakingDangerousA property removed from an open content model.
jsonschema.forward.pattern-changedforwardDangerousBreakingBreakingDangerousA pattern replaced by another.
jsonschema.forward.pattern-loosenedforwardDangerousBreakingBreakingDangerousA pattern removed.
jsonschema.forward.required-removedforwardDangerousBreakingBreakingDangerousA property is no longer required.
jsonschema.forward.schema-accepts-valuesforwardDangerousBreakingBreakingDangerousThe schema stopped being false and now accepts values.
jsonschema.forward.type-changedforwardDangerousBreakingBreakingDangerousA type replaced by an unrelated one, such as integer to string.
jsonschema.forward.type-widenedforwardDangerousBreakingBreakingDangerousA type widened, such as integer to number or null allowed.
jsonschema.forward.unique-items-loosenedforwardDangerousBreakingBreakingDangerousuniqueItems turned off.
jsonschema.review.ref-changedreviewDangerousDangerousDangerousDangerousA $ref that points outside the document changed.
jsonschema.review.unmodeled-keyword-changedreviewDangerousDangerousDangerousDangerousA keyword the check does not model changed, such as not or if.

AsyncAPI rules​

Rule idBreaksBACKWARDFORWARDFULLNONEDescription
asyncapi-diff.breaking—BreakingBreakingBreakingDangerous@asyncapi/diff classified the whole channel or operation as breaking.
asyncapi-diff.non-breaking—SafeSafeSafeSafe@asyncapi/diff classified the whole channel or operation as non-breaking.
asyncapi.both.action-flippedbothBreakingBreakingBreakingDangerousAn operation's action flipped between send and receive. Consumers: breaking; producers: breaking.
asyncapi.both.binding-changedbothBreakingBreakingBreakingDangerousA channel, operation, message or server binding changed. Consumers: breaking; producers: breaking.
asyncapi.both.parameter-added-with-defaultbothSafeSafeSafeSafeAn address parameter added with a default. Consumers: safe; producers: safe.
asyncapi.both.payload-compatiblebothSafeSafeSafeSafeA payload changed in a way its own format accepts both ways. Consumers: safe; producers: safe.
asyncapi.both.protocol-changedbothBreakingBreakingBreakingDangerousA server's protocol changed. Consumers: breaking; producers: breaking.
asyncapi.both.schema-format-changedbothBreakingBreakingBreakingDangerousA payload's schemaFormat changed to another schema language. Consumers: breaking; producers: breaking.
asyncapi.both.security-changedbothDangerousDangerousDangerousDangerousA server's or an operation's security changed. Consumers: dangerous; producers: dangerous.
asyncapi.both.server-changedbothDangerousDangerousDangerousDangerousA server added, removed or moved. Consumers: dangerous; producers: dangerous.
asyncapi.consumer.address-changedconsumerBreakingDangerousBreakingDangerousA channel's address or address template changed. Consumers: breaking; producers: dangerous.
asyncapi.consumer.message-removedconsumerBreakingDangerousBreakingDangerousA message removed from a channel's messages. Consumers: breaking; producers: safe.
asyncapi.consumer.parameter-addedconsumerBreakingDangerousBreakingDangerousAn address parameter added without a default. Consumers: breaking; producers: dangerous.
asyncapi.consumer.reply-removedconsumerBreakingDangerousBreakingDangerousAn operation's reply removed (AsyncAPI 3). Consumers: breaking; producers: dangerous.
asyncapi.producer.message-addedproducerSafeDangerousDangerousSafeA message added to a channel's messages. Consumers: safe; producers: dangerous.

Protobuf rules​

Rule idCategoryWIREWIRE_JSONPACKAGEFILEDescription
buf-breaking.wire-compatible—DangerousDangerousDangerousDangerousbuf breaking found no break, so a rule's breaking grade was lowered to dangerous.
protobuf.buf-breaking.*—BreakingBreakingBreakingBreakingA break buf breaking reported, named after buf's own rule (protobuf.buf-breaking.field_same_json_name), at the category the diff was graded at.
protobuf.compatible—SafeSafeSafeSafeA change the rules explain without a break, such as a number or name reserved.
protobuf.file.type-moved-fileFILESafeSafeSafeBreakingA message or enum moved to another file in the same package.
protobuf.package.field-deletedPACKAGESafeSafeBreakingBreakingA field deleted with its number and name reserved.
protobuf.package.presence-changedPACKAGESafeSafeBreakingBreakingoptional added to or removed from a proto3 field.
protobuf.wire.cardinality-changedWIREBreakingBreakingBreakingBreakingA field made repeated, or no longer repeated.
protobuf.wire.enum-value-number-changedWIREBreakingBreakingBreakingBreakingAn enum value moved to another number.
protobuf.wire.field-number-reusedWIREBreakingBreakingBreakingBreakingA field number now carrying another type.
protobuf.wire.oneof-membership-changedWIREBreakingBreakingBreakingBreakingA field moved into, out of or between oneofs.
protobuf.wire.package-changedWIREBreakingBreakingBreakingBreakingA message or enum moved to another package.
protobuf.wire.required-changedWIREBreakingBreakingBreakingBreakingA field made required, or no longer required.
protobuf.wire.reserved-name-reusedWIREBreakingBreakingBreakingBreakingA reserved name used again.
protobuf.wire.reserved-number-reusedWIREBreakingBreakingBreakingBreakingA reserved number used again.
protobuf.wire.reserved-removedWIREDangerousDangerousDangerousDangerousA reserved number or name removed.
protobuf.wire_json.enum-value-number-reusedWIRE_JSONSafeBreakingBreakingBreakingAn enum value renamed: its number taken by a new name.
protobuf.wire_json.field-deleted-unreservedWIRE_JSONDangerousBreakingBreakingBreakingA field deleted without reserving its number or name.
protobuf.wire_json.field-renamedWIRE_JSONSafeBreakingBreakingBreakingA field renamed, same number and type.
protobuf.wire_json.json-name-changedWIRE_JSONSafeBreakingBreakingBreakingA field's json_name changed.