Diff-Anything / Audit Guides / OpenAPI & Web DOM

Auditing REST Enum Narrowing, Float Truncation & New Required Headers

Subtle schema narrowing causes harder-to-debug failures than endpoint deletions because HTTP requests still return 200 OK while silently corrupting business math. Changing weight_kg from number (float) to integer rounds 1.4 kg down to 1 kg or coerces upstream rejections, while narrowing a request enum breaks legacy webhook filters.

Dropped Enum Values2 of 7 States
Truncated Parcels/Mo9,200 Shipments
Avg Weight Misbilling$1.15/parcel
Monthly Drift Exposure$10,580.00/mo

Worked Logistics Tracking API Diff (v1.8 vs v1.9)

Schema Field / Parameter v1.8 Baseline Spec v1.9 Candidate Spec Operational & Financial Effect
shipment.status request filter enum 7 values incl. CUSTOMS_HOLD, OUT_FOR_DELIVERY 5 values (2 states removed) HTTP 400 on existing customs polling jobs
POST /v1/labels header param X-Idempotency-Key optional required: true 100% label print failures on older WMS agents
parcel.weight_kg numeric schema type: "number", format: "float" type: "integer" 9,200 fractional parcels × $1.15 drift = $10,580.00/mo
Monthly Parcel Misbilling Exposure Exact 0.01 kg decimal rating Integer truncation $10,580.00/mo

Reproducible POST /api/v1/diff Request

{
  "domain": "openapi_dom",
  "baseline": "{\"openapi\":\"3.1.0\",\"paths\":{\"/v1/labels\":{\"post\":{\"parameters\":[{\"name\":\"X-Idempotency-Key\",\"in\":\"header\",\"required\":false}],\"requestBody\":{\"content\":{\"application/json\":{\"schema\":{\"type\":\"object\",\"properties\":{\"weight_kg\":{\"type\":\"number\"},\"status\":{\"type\":\"string\",\"enum\":[\"CREATED\",\"IN_TRANSIT\",\"CUSTOMS_HOLD\",\"OUT_FOR_DELIVERY\",\"DELIVERED\",\"EXCEPTION\",\"RETURNED\"]}}}}}}}}}}",
  "actual": "{\"openapi\":\"3.1.0\",\"paths\":{\"/v1/labels\":{\"post\":{\"parameters\":[{\"name\":\"X-Idempotency-Key\",\"in\":\"header\",\"required\":true}],\"requestBody\":{\"content\":{\"application/json\":{\"schema\":{\"type\":\"object\",\"properties\":{\"weight_kg\":{\"type\":\"integer\"},\"status\":{\"type\":\"string\",\"enum\":[\"CREATED\",\"IN_TRANSIT\",\"DELIVERED\",\"EXCEPTION\",\"RETURNED\"]}}}}}}}}}}"
}

Verified DiffProofReport Output

{
  "ok": true,
  "domain": "openapi_dom",
  "summary": "Caught 3 breaking REST contract regressions: enum narrowed by 2 states, optional header made required, and weight_kg narrowed from number to integer.",
  "total_delta_usd": 10580.0,
  "recoverable_overcharge_usd": 10580.0,
  "severity": "high",
  "line_item_findings": [
    { "id": "enum-01", "category": "enum_narrowing", "item": "POST /v1/labels -> status.enum", "baseline_value": "7 enum values", "actual_value": "5 enum values (dropped CUSTOMS_HOLD, OUT_FOR_DELIVERY)", "delta_usd": 0.0, "severity": "high", "claim_action": "Preserve deprecated enum literals on ingress and map internally" },
    { "id": "enum-02", "category": "new_required_param", "item": "POST /v1/labels -> header X-Idempotency-Key", "baseline_value": "required: false", "actual_value": "required: true", "delta_usd": 0.0, "severity": "critical", "claim_action": "Keep header optional on /v1 and synthesize fallback hash server-side" },
    { "id": "enum-03", "category": "numeric_precision_loss", "item": "POST /v1/labels -> weight_kg", "baseline_value": "number (float)", "actual_value": "integer", "delta_usd": 10580.0, "severity": "critical", "claim_action": "Revert weight_kg to floating-point number to prevent $10,580/mo rounding drift" }
  ],
  "reproducible_counterexamples": [
    { "item": "weight_kg Truncation Drift", "formula": "9200 * 1.15", "expected": 0.0, "observed": 10580.0, "delta_usd": 10580.0 }
  ],
  "sha256_proof": "693de595faccd1cf9f393b71579eafa4365c6b87ea40461f681645fbce66b42",
  "cache_hit": false,
  "verification": { "verified": true, "precision_usd": 0.01 },
  "billed_micros": 50000
}

Scan REST Schema Drift Free Next: API & GraphQL Auth Check · llms.txt