Skip to content

Keeping up with a changing spec

pull fetches every document in sources into specsDir exactly as served, and prints what changed in each one in the terms of the code you consume — the operation, its generated hook, the schema and property. Every document is fetched before any is written, so a failed pull leaves the folder as it was.

sightings: 5 breaking, 0 risky, 34 safe
breaking
✖ GET /sightings (listSightings · useListSightingsQuery)
query parameter `plate` removed

Compare any two documents (files or URLs) yourself, for a PR comment or a CI gate:

Terminal window
openapi-forge diff old.yaml https://host/openapi.json --format markdown
openapi-forge diff old.yaml new.yaml --fail-on breaking # exit 1 on a breaking change

Severity: breaking (removed or retyped operation, parameter, property, response; a new required parameter), risky (a new required property, an enum value removed, a deprecation), safe (additions). Swagger 2.0 documents are compared after the same conversion a run reads them with.