{"openapi":"3.0.3","info":{"title":"AgentCash OpenAPI Diff API","version":"1.1.0","description":"Compares an existing OpenAPI contract with its proposed replacement and reports potential client-breaking changes.","contact":{"name":"Starlight Retail","url":"https://starlightretail.ghe.com/starlightretail/agentcash-apis"},"x-guidance":"Get a free request/report pair at /examples/breaking-change. Submit the current contract as baseline and the proposed one as candidate. Only no_changes with complete coverage is a clean check.","x-contract-semantics":{"price":"$0.03 USDC on Base","comparison_order":"baseline is the contract clients use today; candidate is the proposed replacement","input_limits":{"request_body_max_bytes":2097152,"document_max_bytes":1048576,"maximum_json_nesting_depth":100,"comparison_deadline_ms":5000,"document_format":"OpenAPI 3.0.x or 3.1.x JSON only"},"rules":{"operation_removed":"For each path and HTTP method present in baseline but absent from candidate, report the baseline operation. Added operations are not findings.","parameter_became_required":"Compare effective path-level and operation-level parameters; an operation-level parameter overrides a path-level parameter with the same in value and name, treating header names case-insensitively and names in other locations case-sensitively. Match effective baseline and candidate parameters by in value and name using the same case rules. Report a candidate parameter whose required value is true when the matching baseline parameter is absent or not required. Point to the candidate parameter's required field. A parameter reference must resolve to a supported parameter object.","request_property_became_required":"For matching operations, compare application/json request-body object schemas. Report each candidate required property that was absent from the baseline required list. This includes a property newly added as required. A change to requestBody.required itself is outside this ruleset.","required_response_property_removed":"For matching operations, compare matching response status codes and application/json object schemas. Report each baseline required property no longer guaranteed because its name is absent from candidate required, or absent from candidate properties when additionalProperties is false. Removing a property definition alone is not a finding when its name remains required and is permitted by additionalProperties. Removing a property that was optional in baseline is not a finding.","not_evaluated":"This ruleset does not report added operations, optionality reductions other than the listed required-input changes, non-JSON body schemas, response status-code changes, or requestBody.required changes. Coverage describes evaluation of the four rules only."},"result_semantics":{"status":"changes_found if findings is non-empty; otherwise no_changes, including when coverage is partial.","clean_check":"Only status no_changes together with coverage complete is a clean check.","ruleset_version":"1.1.0 identifies the four rules and their evaluation semantics in this contract, including OpenAPI 3.1 support and allOf evaluation.","impact":"Human-readable client consequence, specific to the finding."},"reference_support":"Resolve only local $ref values beginning with #, including JSON Pointer fragments. Never fetch network or filesystem references. A remote reference or a reference cycle is not evaluated and produces a coverage gap at the reference location. An invalid local reference is an invalid_spec error.","coverage":"complete means all four published rules were evaluated at every applicable supported location. partial means at least one location could not be evaluated; skipped lists each such location and reason. A partial report is not a clean check, even when findings is empty.","json_pointer":"Pointers use RFC 6901 escaping (~ becomes ~0 and / becomes ~1), use zero-based array indices, and address the source document named by document. Removed operations and removed required response properties point to baseline evidence. Newly required parameters and request-body properties point to candidate evidence. Evidence pointers may point inside an allOf branch, for example /components/schemas/X/allOf/1/required.","composition":"allOf is evaluated as a conjunction: a property is guaranteed when required by the enclosing schema or any branch. A request finding requires the property to be guaranteed by the candidate and provably omittable in the baseline; a response finding is the mirror. Evidence may point into an allOf branch; see json_pointer. The OpenAPI 3.0 nullable-reference idiom allOf with a single $ref plus nullable true is evaluated as the referenced schema. A oneOf or anyOf with exactly one object-ish branch whose other branches are all type null is evaluated as that branch. A oneOf or anyOf whose branches are all scalar, enum, or null carries no properties and is treated as scalar. A property that becomes nullable is not a finding.","openapi_31":"Baseline and candidate may be different versions, including 3.0.x against 3.1.x. In 3.1 documents, Schema Object keywords are validated against the JSON Schema 2020-12 meta-schema and jsonSchemaDialect, when present, must be an absolute URI. A type array allows objects when it includes object and is treated as scalar when every non-null member is a scalar type. Local $ref targets in 3.1 documents are checked for existence and URI syntax only; a reference that does not resolve to a supported object produces a coverage gap. In a 3.1 document, a Schema Object with $ref and sibling keywords is evaluated as the conjunction of the referenced schema and the siblings, as JSON Schema 2020-12 specifies; in a 3.0 document, sibling keywords on a $ref are ignored, as OpenAPI 3.0 specifies.","finding_order":"Sort findings by path, method, rule, then pointer using ordinal string order. Sort skipped entries by document, pointer, then reason. Emit one finding per changed parameter or property; a request-body required-list pointer may therefore appear in multiple findings.","supported_constructs":["OpenAPI 3.0.x or 3.1.x JSON documents with paths and HTTP operations","Path-level and operation-level parameters identified by name and location","JSON request bodies with inline object schemas or resolvable local references","JSON response object schemas and required properties","Inline schemas and local references to supported schemas","allOf conjunctions, including the OpenAPI 3.0 nullable-reference idiom","Nullable wrappers: oneOf or anyOf with a single object branch whose other branches are all type null","Scalar-only oneOf or anyOf, treated as a scalar schema with no properties","OpenAPI 3.1 type arrays"],"unsupported_constructs":{"summary":"A construct that prevents evaluating a rule at an applicable location creates a skipped entry at its exact JSON Pointer and changes coverage to partial. Unsupported constructs outside applicable locations do not affect coverage. Keywords under ignored_without_gap do not affect coverage even at applicable locations.","skipped":["oneOf or anyOf with two or more object-ish branches","oneOf or anyOf mixing object-ish branches with non-null scalar branches","not","A property defined in more than one allOf branch: its nested comparison is skipped while its own required-ness is still evaluated","A schema combining additionalProperties false in one branch with properties or required names from another allOf branch","Reference cycles","An absolute or $id-based $ref is treated as an external reference and produces a coverage gap where a rule applies"],"rejected":["A local $ref to a plain-name anchor such as #name (not a JSON Pointer fragment) is rejected with 422 invalid_spec (Invalid local reference.)"],"ignored_without_gap":["$dynamicRef is not read","if, then, else, dependentRequired, prefixItems, unevaluatedProperties, and patternProperties are not evaluated; coverage can be complete while they are present. patternProperties is also not used to prove that a property is forbidden under additionalProperties false: a schema with patternProperties is never treated as closed","unevaluatedProperties false is not treated as closing a schema, unlike additionalProperties false"],"scope":["webhooks operations are not compared; only paths operations are. A document without paths is treated as having no operations."]}}},"servers":[{"url":"/"}],"paths":{"/v1/openapi/diff":{"post":{"operationId":"diffOpenApi","summary":"Compare two OpenAPI contracts","description":"A clean result requires status no_changes and coverage complete.","x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.03"},"protocols":[{"x402":{"scheme":"exact","network":"eip155:8453","asset":"USDC"}}]},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DiffRequest"},"example":{"baseline":{"openapi":"3.0.3","info":{"title":"Orders","version":"1.0.0"},"paths":{}},"candidate":{"openapi":"3.0.3","info":{"title":"Orders","version":"1.1.0"},"paths":{}}}}}},"responses":{"200":{"description":"Comparison completed, including reports with partial coverage.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DiffReport"}}}},"400":{"description":"The request is not a JSON object with exactly baseline and candidate object fields.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"402":{"description":"When challenged with PAYMENT-REQUIRED, sign the accepted requirements and retry with PAYMENT-SIGNATURE. If settlement is declined, inspect PAYMENT-RESPONSE instead; no report is released.","headers":{"PAYMENT-REQUIRED":{"description":"Base64-encoded x402 payment requirements for this comparison.","schema":{"type":"string"}},"PAYMENT-RESPONSE":{"description":"Base64-encoded x402 result when settlement failed.","schema":{"type":"string"}}}},"413":{"description":"The request or either document exceeds its byte limit.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"A document is malformed, not OpenAPI 3.0.x or 3.1.x JSON, or contains an invalid local reference.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"An unexpected comparison failure occurred.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"All comparison workers are busy. Retry later; no payment was settled.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"504":{"description":"Comparison exceeded the five-second deadline or processing budget (including reference expansion and report size). No truncated report is returned.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}},"components":{"schemas":{"DiffRequest":{"type":"object","required":["baseline","candidate"],"additionalProperties":false,"properties":{"baseline":{"type":"object","description":"Current client-facing OpenAPI 3.0.x or 3.1.x JSON document."},"candidate":{"type":"object","description":"Proposed replacement OpenAPI 3.0.x or 3.1.x JSON document."}}},"DiffReport":{"type":"object","required":["status","coverage","ruleset_version","findings","skipped"],"properties":{"status":{"type":"string","enum":["changes_found","no_changes"]},"coverage":{"type":"string","enum":["complete","partial"]},"ruleset_version":{"type":"string","enum":["1.1.0"]},"findings":{"type":"array","items":{"$ref":"#/components/schemas/Finding"}},"skipped":{"type":"array","items":{"$ref":"#/components/schemas/SkippedLocation"}}}},"Finding":{"type":"object","required":["rule","method","path","pointer","document","impact"],"properties":{"rule":{"type":"string","enum":["operation_removed","parameter_became_required","request_property_became_required","required_response_property_removed"]},"method":{"type":"string","enum":["GET","PUT","POST","DELETE","OPTIONS","HEAD","PATCH","TRACE"]},"path":{"type":"string","description":"OpenAPI path template, for example /orders/{id}."},"pointer":{"type":"string","description":"RFC 6901 JSON Pointer to evidence in the document field."},"document":{"type":"string","enum":["baseline","candidate"]},"impact":{"type":"string"}}},"SkippedLocation":{"type":"object","required":["document","pointer","reason"],"properties":{"document":{"type":"string","enum":["baseline","candidate"]},"pointer":{"type":"string","description":"RFC 6901 JSON Pointer to the construct that prevented evaluation."},"reason":{"type":"string"}}},"ErrorResponse":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","enum":["invalid_request","input_too_large","invalid_spec","comparison_timeout","comparison_failed"]},"message":{"type":"string"},"pointer":{"type":"string","description":"Optional JSON Pointer to the invalid input location."}}}}}}}}