Restep2½

Tools · Keep it compatible · v0.2.0

restep-diffDid you break it?

Compares two discovery documents and sorts every change into breaking, deprecation or compatible, with the rule that says so. Exits with 1 when something breaks.

Node 18 or later · npm install -g restep-diff

Why use it

The rule, not an opinion

Every change comes with the rule that classified it and the sections of the specification behind it, mostly 5.5. If you disagree, you are disagreeing with a sentence you can read.

Retirement done right is not breaking

A sort that disappears after its sunset in deprecations is the retirement 5.5 allows. The same sort gone without notice, or before the date, is breaking, and the message says which.

Files or live APIs

Each side is a JSON file or the root URL of an API. Compare what is deployed with what you are about to deploy, or two commits of a committed discovery document.

A gate and a changelog

It exits with 1 when something breaks. --markdown gives a changelog or a pull request comment; --json, something for your own scripts.

How it works

  1. It loads both documents. A file is read as is. From a URL it does what restep-check does: a GET to the root and, if that is not a discovery document, the first rel="service-desc" link that leads to one (4.2). --header credentials only go to each API’s own origin.
  2. It walks the root, every collection and every singleton. At the root: restep (with the grammar and the suffix of 1.1), version, profiles (with core implied), extensions, batch, idempotency (ttl and anonymous, true when missing), events, status, reasons, singletons and deprecations. In each collection: path, parent, description, methods, item_methods, id_from ("server" when missing), filter, named_filters, collations ("codepoint" for a field that is not listed), sort, max_limit, count, relations, include_depth (1 when missing), sync, actions, language_maps, inherit and deprecations. In each singleton (5.9): path, description, methods, its item and update schemas and deprecations; a singleton with a template or a parent counts as absent, because clients ignore it. Two path templates that only rename their variables are the same URL.
  3. It reads the embedded schemas. The top-level properties of schemas.item are what clients receive; those of schemas.create, schemas.update and each action’s input are what they send. So a type that accepts more is compatible on input, while any type change on output is breaking. anyOf and oneOf are flattened: {"anyOf": [s, {"type": "null"}]} reads as “s or null”.
  4. It classifies each change with one of 136 rules, into four severities: breaking, deprecation, compatible and other. Something that disappears is matched against a notice of the kind that fits it, in the place 5.5 puts it: at the root for a profile, an extension, a collection, a singleton or a reason; in the collection or the singleton for the rest. A notice of another kind, or out of place, does not count. A field notice also covers the filters, sorts, includes and input fields of the same name and the dotted paths that start with it, and retiring a profile or an extension also retires those that need it (1.2).
  5. It reports and exits. Text, JSON or Markdown, grouped by severity, each change with a JSON Pointer into the new (or old) document. Exit code 1 if there is anything at the --fail-on level.

A collection’s sync only counts if profiles announces sync (10). If a whole profile or extension goes, profile.removed or extension.removed says so once, not again for each collection. Members starting with x- are ignored (4.2). Any other unknown member that changes shows up under other changes, so nothing slips by in silence.

Install and run

Node 18 or later, no dependencies. Run it with npx, or install it with npm install -g restep-diff (or npm install --save-dev restep-diff in a project).

npx restep-diff old.json new.json
npx restep-diff https://api.example.com/ http://localhost:8080/
npx restep-diff --rules                  # the rule table, in the terminal

Its messages are in Spanish for now, on this page too. Rule ids, severities in --json, pointers and section numbers are the same in any language.

Examples

Two files

The discovery document of a bookshop on main, against the one in a pull request. Someone moved it to a newer minor version of Restep while it still announces experimental parts, made category required on create, lowered max_limit without notice, removed the title sort (announced, with a sunset that has passed) and announced that rating is going away.

$ npx restep-diff main.json pr.json
restep-diff: main.json → pr.json

Incompatibles (3)
  - Restep pasa de "1.0" a "1.1" y se anuncian partes experimentales (sync, batch): solo las usa el cliente que implementa el texto de 1.1 (§1.2)
      /restep  [restep.experimental; §1.2]
  - «category» pasa a ser obligatorio en el cuerpo del POST de «books»
      /collections/books/schemas/create/properties/category  [input.now-required; §5.5]
  - max_limit de «books» pasa de 50 a 25 sin aviso previo en deprecations
      /collections/books/max_limit  [max-limit.lower; §5.5, §6.4]

Retiradas y avisos (2)
  - «books» deja de admitir ordenar por «title»: retirada tras su sunset (2026-06-01T00:00:00Z), como permite §5.5 [sort.removed]
      /collections/books/sort  [deprecation.retired; §5.5, §12]
  - Se anuncia la retirada de field «rating» de «books», con sunset 2027-09-01T00:00:00Z
      /collections/books/deprecations  [deprecation.announced; §5.5]

Compatibles (6)
  - Restep pasa de "1.0" a "1.1"
      /restep  [restep.minor-up; §1.1]
  - Colección nueva «shelves» en "/shelves"
      /collections/shelves  [collection.added; §5.5]
  - «books» tiene un campo nuevo, «year»
      /collections/books/schemas/item/properties/year  [field.added; §5.5, §3]
  - El cuerpo del POST de «books» admite «year»
      /collections/books/schemas/create/properties/year  [input.added-optional; §5.5]
  - «books» admite el filtro «year» (eq, lt, gt)
      /collections/books/filter/year  [filter.added; §5.5, §6.1]
  - «authors» admite PATCH en sus elementos
      /collections/authors/item_methods  [method.added; §4.3, §5.5]

Otros cambios (2)
  - Cambia la descripción de «books»
      /collections/books/description  [description.changed; §4.3, §5.6]
  - Cambia la descripción de la acción «reserve» de «books»
      /collections/books/actions/reserve/description  [description.changed; §4.3, §5.6]

Resumen: 3 incompatibles, 2 retiradas y avisos, 6 compatibles, 2 otros.
$ echo $?
1

The minor version going up is compatible in itself, but a client that implemented the experimental sync and batch of 1.0 may not use them under 1.1, hence restep.experimental. The three breaking changes make it exit with 1. The retired sort does not: it was announced and its date has passed. With --fail-on deprecation the retirement and the new notice would fail too; with --fail-on none, nothing does.

A file against a running API

The document saved from main, against the reference server running locally with this branch’s code. One sort and some room in max_limit are gone, without notice; the rating filter gained null; and categories now accepts ids chosen by the client.

$ npx restep-diff discovery-main.json http://localhost:8080/
restep-diff: discovery-main.json → http://localhost:8080/

Incompatibles (2)
  - «books» deja de admitir ordenar por «author» sin aviso previo en deprecations
      /collections/books/sort  [sort.removed; §5.5, §6.2]
  - max_limit de «books» pasa de 100 a 50 sin aviso previo en deprecations
      /collections/books/max_limit  [max-limit.lower; §5.5, §6.4]

Compatibles (1)
  - El filtro «rating» de «books» admite null
      /collections/books/filter/rating/ops  [filter.op-added; §5.5, §6.1]

Otros cambios (1)
  - id_from de «categories» pasa de (sin declarar) a "either"
      /collections/categories/id_from  [id-from.either; §5.5, §5.1]

Resumen: 2 incompatibles, 0 retiradas y avisos, 1 compatibles, 1 otros.

The id_from change is compatible only if the server tells apart every id the collection has had (5.1), which the document cannot show, so it goes under other changes.

If the API needs credentials, add --header "Authorization: Bearer $TOKEN". Descriptions can change with the language (5.6), so if you compare two live APIs, pin it with --language en.

A pull request comment

$ npx restep-diff main.json pr.json --markdown
## Cambios en la API

Comparación de `main.json` con `pr.json` según las reglas de evolución de [Restep 1](https://restep.wubytes.com/es/1/#versiones).

**3** incompatibles · **2** retiradas y avisos · **6** compatibles · **2** otros

### Incompatibles

- Restep pasa de "1.0" a "1.1" y se anuncian partes experimentales (sync, batch): solo las usa el cliente que implementa el texto de 1.1 (§1.2) (`/restep`; [§1.2](https://restep.wubytes.com/es/1/#dependencias))
- «category» pasa a ser obligatorio en el cuerpo del POST de «books» (`/collections/books/schemas/create/properties/category`; [§5.5](https://restep.wubytes.com/es/1/#versiones))
- max\_limit de «books» pasa de 50 a 25 sin aviso previo en deprecations (`/collections/books/max_limit`; [§5.5](https://restep.wubytes.com/es/1/#versiones), [§6.4](https://restep.wubytes.com/es/1/#paginacion))
…

Paste it into the pull request, or let restep-action do it and keep the comment up to date.

JSON, for your own scripts

$ npx restep-diff main.json pr.json --json
{
  "old": "main.json",
  "new": "pr.json",
  "date": "2026-11-20T00:00:00.000Z",
  "summary": { "breaking": 3, "deprecation": 2, "compatible": 6, "info": 2 },
  "changes": [
    {
      "rule": "restep.experimental",
      "severity": "breaking",
      "sections": ["1.2"],
      "location": "/restep",
      "message": "Restep pasa de \"1.0\" a \"1.1\" y se anuncian partes experimentales (sync, batch): solo las usa el cliente que implementa el texto de 1.1 (§1.2)",
      "links": ["https://restep.wubytes.com/es/1/#dependencias"]
    },
    …
  ]
}

In CI

If the repository keeps its discovery document in a file, compare the base branch with the pull request. The job fails on a breaking change.

# .github/workflows/restep-diff.yml (one job)
steps:
  - uses: actions/checkout@v4
    with: { fetch-depth: 0 }
  - run: git show "origin/${{ github.base_ref }}:api/discovery.json" > base.json
  - run: npx -y restep-diff@0.2 base.json api/discovery.json --markdown >> "$GITHUB_STEP_SUMMARY"

Or compare what is deployed with the API the job has just started: npx restep-diff https://api.example.com/ http://localhost:8080/ --markdown.

The 136 rules

This is what --rules prints. Each rule says which severity it gives and which sections back it; most rest on 5.5 and its table of changes. Where the specification says nothing, the text says what was decided and why.

Breaking 66

What 5.5 says a server MUST NOT do within a version, except by retiring it, and the changes of Restep version after which 1.1 and 1.2 say a client can no longer assume what it did. Exit code 1 by default.

RuleWhat it detects§
restep.majorRestep’s major version changes: “a breaking change will be Restep 2, with new URIs”, and a Restep 1 client MUST NOT treat a document of another major version as its own.§1.1
restep.prereleaseRestep’s version changes and one of the two carries a suffix (-draft.N or -rc.N): a draft or a candidate may differ incompatibly from the published version and from any other draft, and the client MUST NOT assume its guarantees.§1.1
restep.experimentalRestep’s version changes and experimental profiles or extensions are still announced: a client MUST NOT use them except under a version whose text of them it implements, so one that implemented the previous text stops using them.§1.2
restep.invalidThe new restep does not follow the grammar of §1.1 (major.minor[-draft.N|-rc.N], no leading zeros): a Restep 1 client MUST NOT treat it as a discovery document.§1.1
version.changedThe API’s major version changes: “each version is a separate API root”, only created for a breaking change.§5.5
profile.removedA profile is no longer announced: “removing […] a profile” is breaking; it is retired with a profile notice, or with that of a profile it needs (§5.5).§5.5
extension.removedAn extension is no longer announced: “removing […] an extension” is breaking; it is retired with an extension notice (§5.5).§5.5, §11
batch.pathbatch.path changes: “changing […] the URLs of resources” is breaking.§5.5, §11.2
batch.max-operations.lowerbatch.max_operations goes down: a batch that used to fit now gets 413, and “tightening validation” is breaking.§5.5, §11.2
idempotency.ttl-too-lowidempotency.ttl goes below 86400 s: it misses the minimum of §7.1, and the table in §5.5 only makes it compatible if it meets it.§5.5, §7.1
idempotency.anonymous-refusedidempotency.anonymous becomes false: “starting to refuse Idempotency-Key without credentials” tightens validation, and is breaking.§5.5, §7.1
events.changedevents changes or disappears: “removing […] the API’s events” and “changing […] the URLs of resources” are breaking.§5.5, §10
reasons.undeclaredreasons stops being declared: “removing reasons once declared” is breaking.§5.5, §5.4
reason.removedA reason disappears from reasons: “removing a reason” is breaking; it is retired with a reason notice (§5.5).§5.5, §5.4
reason.codeA reason’s code changes: “changing the code of a reason” is breaking.§5.5, §5.4
collection.removedA collection disappears: “removing […] a collection” is breaking.§5.5
collection.pathA collection’s path changes: “changing […] the URLs of resources” is breaking.§5.5
collection.parentA subcollection’s parent changes or disappears: it hangs from another collection, or stops saying which.§4.2, §5.5
singleton.removedA singleton disappears, or gains a template or a parent that make clients ignore it (§5.9): “removing […] a singleton” is breaking.§5.5, §5.9
singleton.pathA singleton’s path changes: “changing […] the URLs of resources” is breaking.§5.5, §5.9
method.removedA declared method is removed: “removing […] a method” is breaking.§5.5, §4.3
id-from.changedAny other change of id_from: breaking according to the table in §5.5.§5.5, §5.1
field.removedA field disappears from the representation: “removing or renaming a field” is breaking.§5.5
field.typeA field of the representation changes type: “changing its type” is breaking.§5.5
field.optionalA field that always came is no longer required in the item schema: it may be missing, as if removed.§5.5
input.added-requiredNew required input field: “making an input field […] required when it was not” is breaking.§5.5
input.now-requiredAn input field becomes required: breaking.§5.5
input.removedAn input field disappears: “removing or renaming a field” is breaking.§5.5
input.type-narrowedAn input field’s type changes or narrows: “changing its type” and “tightening validation” are breaking.§5.5
input.enum-removedAn input field stops accepting an enum value: “tightening validation” is breaking.§5.5
input.constraint-tightenedA constraint on an input field tightens or appears (pattern, format, lengths, ranges, enum): “tightening validation” is breaking.§5.5
input.default-changedThe default of a POST field changes: the same create without that field now stores another value (§4.3), a change of meaning that §5.5 makes breaking.§4.3, §5.5
input.default-removedA POST field loses its default: a create without it leaves it empty instead of setting the value it used to (§4.3).§4.3, §5.5
input.closedThe body becomes additionalProperties: false: it rejects members it used to accept (“tightening validation”).§5.5, §4.3
filter.removedA filter disappears: “removing a filter” is breaking; it now gives unsupported_parameter. It is retired with a filter or field notice.§5.5, §6.1, §5.3
filter.op-removedA filter loses an operator: “removing an […] operator” is breaking; it is retired with an operator notice.§5.5, §6.1, §5.3
filter.typeA filter’s type changes: the server compares by the declared type (§6.1); changing the type is breaking.§5.5, §6.1
filter.values-removedAn enum filter stops accepting a value: “removing […] a value from a declared enumeration” is breaking; it is retired with a value notice.§5.5, §6.1
collation.changedAny other declaration or change of collations on a field whose filter or sort already existed: “changing […] the collation of a field” is breaking.§5.5, §6.1
named-filter.removedA named filter disappears: removing a filter (a named one too) is breaking; it now gives unsupported_parameter.§5.5, §6.1, §5.3
named-filter.typeA named filter’s type changes, or it goes from a switch to taking a value or back: what used to be accepted gives invalid_parameter.§5.5, §6.1
named-filter.values-removedAn enum named filter stops accepting a value: it now gives invalid_parameter, and “tightening validation” is breaking.§5.5, §6.1
sort.removedA sort key disappears: “removing […] a sort key” is breaking; it now gives unsupported_parameter.§5.5, §6.2
max-limit.lowermax_limit goes down: it is retired with a max_limit notice whose value is the new limit (table in §5.5).§5.5, §6.4
max-limit.removedmax_limit stops being declared: breaking according to the table in §5.5, because without it limit is not accepted (§6.4).§5.5, §6.4
count.removedcount stops being declared: “removing […] a count” is breaking; it is retired with a count notice without value.§5.5, §6.5
count.estimatedcount goes from exact to estimated: it is retired with a count notice with "estimated" in value (table in §5.5).§5.5, §6.5
relation.removedA relationship disappears: “removing […] a relationship” is breaking.§5.5, §9
relation.toA relationship’s target collection changes, it loses one of its targets, or it goes from one target to several or back (the link gains or loses type, §3): “changing its meaning” is breaking.§5.5, §9
relation.manyA relationship goes from to-one to to-many or back: the field changes type (object or list, §3).§5.5, §3
relation.include-removedA relationship can no longer be included: “removing […] an include” is breaking; it is retired with an include notice.§5.5, §9
relation.pathA relationship’s path changes or disappears: “changing […] the URLs of resources” is breaking.§5.5, §9
include-depth.lowerinclude_depth goes down: a path that used to work gives unsupported_parameter.§5.5, §9
sync.removedThe collection stops declaring sync: “removing […] a collection’s sync” is breaking, and :changes now gives 404.§5.5, §10
sync.retention-too-lowsync.retention goes below 7 days, the minimum of §10: the table in §5.5 only makes it compatible if it meets it.§5.5, §10
action.removedAn action disappears: “removing […] an action” is breaking.§5.5, §11.1
action.onAn action moves from item to collection or back: its URL changes.§5.5, §11.1
action.methodAn action changes method (POST or GET): a method is removed.§5.5, §11.1
action.weakerAn action is no longer safe or idempotent: breaking according to the table in §5.5; the action is retired and another name declared.§5.5, §11.1
language-map.retypedA field that already existed becomes a language map: its type changes.§3, §5.5
language-map.removedA field stops being a language map: “the type of a language map MUST NOT change”.§3, §5.5
inherit.writableInheritance on a field that could be written: “turning into an effective field one that could be written until now is not”.§11.6, §5.5
inherit.removedAn inherit declaration disappears: the own field stops existing or changes meaning.§11.6, §5.5
inherit.ownThe name of the own field changes: “removing or renaming a field” is breaking.§5.5, §11.6
inherit.default-removedThe inheritance loses its default: the effective field, which was never empty, can now have no value.§11.6, §5.5
deprecation.announced-changedA deprecation notice’s announced changes: it “MUST NOT change afterwards”.§5.5

Deprecations and retirements 4

New or changed notices in deprecations, and what disappears after a sunset that has passed.

RuleWhat it detects§
deprecation.announcedNew deprecation notice in deprecations: responses that use what it retires MUST carry Deprecation.§5.5
deprecation.short-noticeA deprecation notice with less than six months between its announced (or --date, if it has none) and its sunset: “at least six months SHOULD pass”.§5.5
deprecation.sunset-changedA deprecation notice’s sunset date changes.§5.5
deprecation.retiredSomething announced in deprecations disappears after its sunset: the retirement §5.5 allows.§5.5, §12

Compatible 45

What a server MAY do at any time. Some rows of the table in 5.5 are compatible on a condition the document does not show; the message recalls it.

RuleWhat it detects§
restep.minor-upRestep’s minor version goes up, with no suffix on either side: “a minor version only adds”, and what conforms to 1.0 still conforms to 1.1.§1.1
profile.addedA new profile is announced: “adding profiles or extensions” is compatible.§5.5, §1.2
extension.addedA new extension is announced: “adding profiles or extensions” is compatible.§5.5, §11
batch.max-operations.higherbatch.max_operations goes up: everything accepted before is still accepted.§5.5, §11.2
idempotency.ttl-higheridempotency.ttl goes up: compatible according to the table in §5.5.§5.5, §7.1
idempotency.ttl-loweridempotency.ttl goes down, not below 86400 s: compatible if the server keeps the old period for keys already stored (table in §5.5), which the document does not say.§5.5, §7.1
idempotency.anonymous-acceptedidempotency.anonymous stops being false: keys without credentials that used to get 400 are now accepted.§7.1
events.addedevents is declared: adding a resource is compatible.§5.5, §10
reasons.declaredreasons is declared: “declaring reasons or adding reasons to it” is compatible.§5.5, §5.4
reason.addedNew reason in reasons: “adding reasons to it” is compatible.§5.5, §5.4
collection.addedNew collection: “adding […] collections” is compatible.§5.5
singleton.addedNew singleton: “adding […] singletons” is compatible.§5.5, §5.9
method.addedOne more method is supported: the list is exact (§4.3), and a client that does not know it ignores it.§4.3, §5.5
methods.undeclaredmethods or item_methods stops being declared: compatible according to the table in §5.5 if the API behaves the same, because without the list it is “unknown” (§4.3).§5.5, §4.3
schema.removedA schema stops being declared: compatible according to the table in §5.5 if the API behaves the same; its fields cannot be compared.§5.5, §4.3
field.addedNew field in the representation: “adding fields to a representation” is compatible.§5.5, §3
field.enum-addedNew enum value in a representation: “adding […] enum values” is compatible; clients tolerate them (§3).§5.5, §3
input.added-optionalNew optional input field: adding optional parameters is compatible.§5.5
input.now-optionalAn input field is no longer required: everything accepted before is still accepted.§5.5
input.type-widenedAn input field accepts more types: everything accepted before is still accepted.§5.5
input.enum-addedAn input field accepts a new enum value: “adding […] enum values” is compatible.§5.5
input.constraint-relaxedA constraint on an input field relaxes or goes away: everything accepted before is still accepted.§5.5
input.openedThe body stops being closed: everything accepted before is still accepted.§5.5, §4.3
filter.addedNew filter: “supporting new filters […]” is compatible.§5.5, §6.1
filter.op-addedNew operator on a filter: supporting new filters is compatible.§5.5, §6.1
filter.values-addedAn enum filter accepts a new value: adding enum values is compatible.§5.5, §6.1
collation.namedcollations goes from "server" to another value: compatible if it names the equality and order it already used (table in §5.5), which restep-diff cannot check.§5.5, §6.1
named-filter.addedNew named filter: “supporting new filters […]” is compatible.§5.5, §6.1
named-filter.values-addedAn enum named filter accepts a new value: adding enum values is compatible.§5.5, §6.1
sort.addedNew sort key: “supporting […] new sorts” is compatible.§5.5, §6.2
max-limit.highermax_limit goes up: compatible according to the table in §5.5.§5.5, §6.4
max-limit.addedmax_limit starts being declared: limit is now accepted, a new capability.§6.4
count.addedcount is declared: a new capability is compatible.§5.5, §6.5
count.exactcount goes from estimated to exact: compatible according to the table in §5.5.§5.5, §6.5
relation.addedNew relationship: adding fields is compatible.§5.5, §9
relation.include-addedA relationship can now be included: “supporting […] new includes” is compatible.§5.5, §9
include-depth.higherinclude_depth goes up: more includes are accepted.§5.5, §9
sync.addedThe collection becomes synced (it declares sync and the profile is announced): a new capability is compatible.§5.5, §10
sync.retention-highersync.retention goes up: compatible according to the table in §5.5.§5.5, §10
sync.retention-lowersync.retention goes down, not below 7 days: compatible if the server keeps the old period for states already issued (table in §5.5), which the document does not say.§5.5, §10
action.addedNew action: “adding […] actions” is compatible.§5.5, §11.1
action.strongerAn action becomes safe or idempotent: compatible according to the table in §5.5.§5.5, §11.1
language-map.addedNew field that is a language map: adding fields is compatible.§5.5, §3
inherit.addedInheritance on a new piece of data or on a read-only field: “adding inheritance to new data, or to a field that was already read-only, is compatible”.§11.6
inherit.default-addedThe inheritance gains a default: the effective field is never empty any more.§11.6

Other changes 21

What the specification does not classify, or what cannot be judged from the document alone.

RuleWhat it detects§
restep.minor-downRestep’s minor version goes down: the specification does not cover it; the other rules flag whatever disappears.§1.1
restep.fixedThe old restep did not follow the grammar of §1.1 and the new one does.§1.1
idempotency.ttl-declarationidempotency.ttl starts or stops being declared: it SHOULD be declared (§7.1); the 24-hour minimum applies either way.§7.1
status.changedThe status link changes: the service status is not an API resource (§4.4).§4.4
collection.parent-declaredA subcollection declares parent with the same path: draft 6 requires it of every subcollection; no URL changes.§4.2
description.changedA description changes: it is text for people, and may even vary with Accept-Language (§5.6).§4.3, §5.6
methods.declaredmethods or item_methods starts being declared: before it was “unknown”, now the list is exact.§4.3
id-from.eitherid_from goes from undeclared or "server" to "either": compatible only if the server tells apart every id the collection has had (table in §5.5); the document does not say.§5.5, §5.1
schema.addedA schema that was not there is declared: it describes, it does not promise (§4.3).§4.3
schema.linkA schema that is a link changes (or becomes one): restep-diff does not download schemas, so it does not compare their fields.§4.3
field.enum-removedA representation stops using an enum value: §5.5 does not classify it.§5.5
input.default-addedA POST field gains a default: a create without it no longer leaves it empty, but sets that value (§4.3). §5.5 does not classify it.§4.3, §5.5
named-filter.descriptionA named filter’s description changes, and it is what says which items it returns: if what it returns changes, the change is breaking even though discovery does not show it.§6.1
sync.retention-declarationsync.retention starts or stops being declared: it SHOULD be declared (§10).§10
inherit.unknownInheritance on an existing field, with no input schemas to tell whether it was writable: review it (§11.6, Evolution).§11.6
relation.to-addedA relationship that already pointed to several collections gains a target: its links may carry a new type. §5.5 does not classify it; §3 asks clients to tolerate new values only in enums.§9, §3
relation.path-declaredA relationship declares path: the template of the subcollection it leads to (§9). No URL changes.§9
inherit.fromAn inheritance’s from chain changes: where the value comes from changes, not its type.§11.6
deprecation.unknown-kindNew notice with a kind that does not exist in that place (root, collection or singleton): clients MUST NOT use it, and restep-diff does not count it either.§5.5, §4.2
deprecation.withdrawnA deprecation notice disappears and what it announced is still there: a change of mind.§5.5
member.changedAnother discovery member that restep-diff does not classify changes.§4.2

Options

restep-diff <old> <new> [options], where each side is a JSON file with a discovery document or the root URL of an API. Or restep-diff --rules [--json | --markdown].

OptionWhat it does
--jsonJSON output: old, new, date, summary by severity and changes, each with rule, severity, sections, location (a JSON Pointer into the new or the old document), message and links
--markdownMarkdown output, for a changelog or a pull request comment
--fail-on breaking|deprecation|noneWhen to exit with 1: on breaking changes (the default), also on deprecations and retirements, or never
--date <instant>The instant (RFC 3339) used to decide whether a sunset has passed and, for a notice without announced, whether it gives six months. Defaults to now
--header "Name: value"Header for fetching the documents over HTTP, such as Authorization. Repeatable. It goes to both sides, but only to each API’s own origin
--language <tag>Accept-Language for those requests: descriptions can change with it (5.6)
--rulesLists the rules with their severity and sections; with --json or --markdown, in that format
--version, --helpThe version, and a short help

Exit codes: 0, nothing at the --fail-on level; 1, something is; 2, a usage error or a document that could not be loaded.

Limits

  • It only sees the discovery document. Headers (Deprecation, Sunset, successor-version), error codes, the default order and the format of ids are also protected by 5.5, but they are not in the document. restep-check checks the headers of a retirement.
  • Schemas that are links are not downloaded: it only says when the link changes.
  • From schemas it compares top-level properties, their types, enum, required, additionalProperties and the constraints pattern, format, const, multipleOf, lengths, ranges and item counts. It does not follow $ref or allOf, nor compare nested objects.
  • It does not check that each document conforms to draft 6 on its own (the grammar of names, that every notice has announced, that a subcollection declares parent…): that is restep-check’s job.
  • A rename looks like one field, collection or relationship that disappears and another that appears.
  • --header and --language apply to both sides.
  • Messages are in Spanish, and the links in the output point to the Spanish version of the specification.

The six months of 5.5 count from the notice’s announced; if a notice does not carry it, from --date. Some changes neither 5.5 nor its table classify: a new Restep version with a suffix, or experimental parts after a version change (both treated as breaking), declaring collations as "codepoint" on a field that already was (not flagged), lowering a period below its minimum (breaking), changing an inheritance’s from. The rule table says what was decided for each one. Some things still have no notice kind that could retire them (include_depth, batch.max_operations, events, a collection’s sync, a subcollection’s parent), so removing or lowering them is always breaking within a version.

All the tools