CtrlK
BlogDocsLog inGet started
Tessl Logo
PluginPublic

trysac/openapi-diff

Compare two OpenAPI 3.0/3.1 JSON specs and classify each change as breaking, warning or info with ten rules. Use when reviewing an API contract change, checking for breaking changes before a release, or gating CI on API compatibility.

Quality

95%

Does it follow best practices?

Run evals on this skill

Adds up to 20 points to the overall score

View guide
SecuritybySnyk

Low

Low-risk findings worth noting

Overview
Quality
Evals
Security
Files

rules.mdreferences/

Classification rules

scripts/openapi_diff.py compares two OpenAPI 3.0.x or 3.1.x documents and labels every change with one of ten rules.

RuleSeverityMeaning
operation-removedbreakingAn operation present in the base is missing in the head.
operation-addedinfoA new operation appears in the head.
param-addedbreaking if required, otherwise infoA parameter appears.
param-removedwarningA parameter disappears.
param-became-requiredbreakingA parameter changes from optional to required.
request-property-became-requiredbreakingA request property is newly required, or requestBody.required goes from false to true.
request-enum-value-removedbreakingA request enum loses a value.
response-property-removedbreakingA response schema loses a property.
response-enum-value-addedwarningA response enum gains a value.
type-changedbreaking or warningA request type set loses a member or a response type set gains one; a change inside allOf, oneOf, anyOf or not is one warning, "composition changed, not analysed".

Matching

  • Paths match after replacing every {name} with {}; otherwise they must be equal, so a trailing slash makes a different path.
  • Parameters merge path-level and operation-level entries (the operation wins) and are identified by name and location. Header names are case-insensitive. Path parameters are matched by their position in the path template.
  • Only local references (#/...) are supported; they are resolved lazily and cycles terminate.
  • Only JSON media types (application/json and +json) are compared, and only for response statuses present on both sides.
  • Types are compared as sets: OpenAPI 3.0 nullable: true adds null, 3.1 type arrays are sets and integer is a subset of number. A schema without type accepts every type.
  • Request schemas ignore readOnly properties and response schemas ignore writeOnly properties.
  • Enum values compare as JSON values: 1 equals 1.0, "1" differs from 1.

Limits

  • Specification size: 10,485,760 bytes.
  • Schema nesting: 64 levels. Reference chains: 64 hops.
  • Schema-pair comparisons: 100,000.
  • Out of scope: Swagger 2.0, external references, response status and security changes, examples and deep oneOf or anyOf semantics.

Output

Text: one line per change, [severity] rule METHOD path: message (pointer), then N breaking, N warning, N info. JSON: {"changes": [...], "summary": {...}} where each change has rule, severity, pointer, message, method and path. Changes are sorted by path, method and pointer.

references

SKILL.md

tile.json