Skip to main content

Module diff

Module diff 

Source
Expand description

Compatibility diffing between two generated OpenAPI documents.

Once a spec is generated it can no longer disagree with the code, so the question worth gating shifts: not “does this match?” but “did this break the people calling it?”. That is a comparison against the merge-base, and its answer is aimed at consumers rather than at the author.

Requiredness means opposite things in the two directions, which is the subtlety the whole comparison turns on (see crate::compat):

  • Request (client → server): the server growing stricter breaks callers. A newly required field is breaking; dropping a requirement is not.
  • Response (server → client): the server providing less breaks callers. A field that stops being guaranteed is breaking; a new one is not.

Functions§

diff
Compare two generated documents, oldest first.