# OpenAPI Consumer Breakage Gate (`ceddl/openapi-consumer-breakage-gate`) Actor

Compare OpenAPI 3.x contracts with versioned consumer profiles, checked waivers, stable findings, SARIF, JUnit, JSON, and Markdown evidence.

- **URL**: https://apify.com/ceddl/openapi-consumer-breakage-gate.md
- **Developed by:** [Cedric Günther](https://apify.com/ceddl) (community)
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $100.00 / 1,000 consumer gate completeds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## OpenAPI Consumer Breakage Gate

Turn an OpenAPI contract comparison into consumer-specific release evidence.
The Actor wraps an exactly pinned oasdiff engine with versioned profiles,
checked waivers, stable fingerprints, and portable JSON, SARIF, JUnit, and
Markdown outputs.

### Typical workflow

1. Supply baseline and revision OpenAPI 3.0, 3.1, or 3.2 documents inline or at
   public HTTPS URLs.
2. Name the consumer profile and choose its minimum level/explicit rule
   overrides. Add reviewed fingerprint waivers where necessary.
3. Run from CI, an Apify Task, API, or schedule.
4. Use the dataset for triage, `OUTPUT` for the verdict, and the three report
   records for code scanning, test reporting, and release notes.

```json
{
    "baseline": { "url": "https://example.com/openapi-v1.json" },
    "revision": { "url": "https://example.com/openapi-v2.json" },
    "consumerProfile": {
        "id": "public-typescript-sdk",
        "version": "1",
        "minimumLevel": "WARN",
        "severityOverrides": {}
    },
    "waivers": [],
    "evaluationDate": "2026-09-16",
    "maxSpecBytes": 2000000,
    "maxFindings": 2000,
    "engineTimeoutSecs": 30
}
```

`evaluationDate` is explicit so waiver results are reproducible. Each spec must
have exactly one of `content` or `url`. Cloud input accepts `content` as an
OpenAPI object; URL content may be JSON or YAML.

### Output contract

Every finding includes the oasdiff rule ID, original and profile-adjusted
level, stable fingerprint, waiver status/reason, operation/path, text, profile
identity, and engine version. Findings sort by fingerprint for stable output.

The verdict is:

- `FAIL` when an unwaived effective `ERR` exists;
- `WARN` when no error but an unwaived `WARN` exists;
- `PASS` otherwise.

Artifacts are written to `REPORT_SARIF`, `REPORT_JUNIT`, and
`REPORT_MARKDOWN`. The default dataset view is `findings`.

### Security and limits

The production image pins oasdiff `1.32.1` and verifies the release archive
SHA-256 during build. External `$ref` resolution is disabled. Root URL inputs
must be credential-free public HTTPS URLs, may not redirect, and may not resolve
to private/reserved addresses. Specs, findings, runtime, and process output are
bounded. No repository credentials or OAuth are accepted.

oasdiff is distributed under Apache-2.0. Its license is included at
`third_party/oasdiff-LICENSE`; this Actor is not affiliated with oasdiff.

### Failure behavior

Invalid configuration, YAML/JSON, OpenAPI version, unsafe fetch, engine timeout,
engine error, or limit breach fails closed and produces no completed comparison
event. An empty change set is a valid `PASS`, not an error.

### Scope boundary

This Actor compares declared contracts. It does not call endpoints, test server
behavior, generate SDKs, comment on pull requests, authenticate to repositories,
resolve private references, or certify API compatibility. oasdiff remains free
open-source software; the hosted value is the profile, waiver, evidence, and
managed integration layer.

### Development

```sh
npm install
set OASDIFF_PATH=C:\path\to\oasdiff.exe
npm test
npm run quality
npm run benchmark
```

### Changelog

- `0.1.0` — Pinned oasdiff wrapper, bounded OpenAPI 3.x input, consumer
  profiles, waivers, deterministic findings, SARIF, JUnit, and Markdown.

# Actor input Schema

## `baseline` (type: `object`):

Earlier contract supplied inline or through a public HTTPS URL.

## `revision` (type: `object`):

Proposed contract supplied inline or through a public HTTPS URL.

## `consumerProfile` (type: `object`):

Versioned consumer policy used to classify engine findings.

## `waivers` (type: `array`):

Explicit fingerprint waivers with reviewed reasons and optional expiration dates.

## `evaluationDate` (type: `string`):

Explicit ISO date used to evaluate waiver expiration deterministically.

## `maxSpecBytes` (type: `integer`):

Reject either root specification when it exceeds this UTF-8 byte limit.

## `maxFindings` (type: `integer`):

Fail closed when the engine produces more findings than this bound.

## `engineTimeoutSecs` (type: `integer`):

Maximum seconds allowed for the pinned diff engine process.

## Actor input object example

```json
{
  "baseline": {
    "content": {
      "openapi": "3.1.0",
      "info": {
        "title": "Store QA Widgets API",
        "version": "1.0.0"
      },
      "paths": {
        "/widgets": {
          "get": {
            "operationId": "listWidgets",
            "responses": {
              "200": {
                "description": "OK"
              }
            }
          }
        }
      }
    }
  },
  "revision": {
    "content": {
      "openapi": "3.1.0",
      "info": {
        "title": "Store QA Widgets API",
        "version": "2.0.0"
      },
      "paths": {}
    }
  },
  "consumerProfile": {
    "id": "store-qa-consumer",
    "version": "1",
    "minimumLevel": "WARN",
    "severityOverrides": {}
  },
  "waivers": [],
  "evaluationDate": "2026-09-16",
  "maxSpecBytes": 2000000,
  "maxFindings": 2000,
  "engineTimeoutSecs": 30
}
```

# Actor output Schema

## `findings` (type: `string`):

No description

## `summary` (type: `string`):

No description

## `sarif` (type: `string`):

No description

## `junit` (type: `string`):

No description

## `markdown` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "baseline": {
        "content": {
            "openapi": "3.1.0",
            "info": {
                "title": "Store QA Widgets API",
                "version": "1.0.0"
            },
            "paths": {
                "/widgets": {
                    "get": {
                        "operationId": "listWidgets",
                        "responses": {
                            "200": {
                                "description": "OK"
                            }
                        }
                    }
                }
            }
        }
    },
    "revision": {
        "content": {
            "openapi": "3.1.0",
            "info": {
                "title": "Store QA Widgets API",
                "version": "2.0.0"
            },
            "paths": {}
        }
    },
    "consumerProfile": {
        "id": "store-qa-consumer",
        "version": "1",
        "minimumLevel": "WARN",
        "severityOverrides": {}
    },
    "waivers": [],
    "evaluationDate": "2026-09-16"
};

// Run the Actor and wait for it to finish
const run = await client.actor("ceddl/openapi-consumer-breakage-gate").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "baseline": { "content": {
            "openapi": "3.1.0",
            "info": {
                "title": "Store QA Widgets API",
                "version": "1.0.0",
            },
            "paths": { "/widgets": { "get": {
                        "operationId": "listWidgets",
                        "responses": { "200": { "description": "OK" } },
                    } } },
        } },
    "revision": { "content": {
            "openapi": "3.1.0",
            "info": {
                "title": "Store QA Widgets API",
                "version": "2.0.0",
            },
            "paths": {},
        } },
    "consumerProfile": {
        "id": "store-qa-consumer",
        "version": "1",
        "minimumLevel": "WARN",
        "severityOverrides": {},
    },
    "waivers": [],
    "evaluationDate": "2026-09-16",
}

# Run the Actor and wait for it to finish
run = client.actor("ceddl/openapi-consumer-breakage-gate").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "baseline": {
    "content": {
      "openapi": "3.1.0",
      "info": {
        "title": "Store QA Widgets API",
        "version": "1.0.0"
      },
      "paths": {
        "/widgets": {
          "get": {
            "operationId": "listWidgets",
            "responses": {
              "200": {
                "description": "OK"
              }
            }
          }
        }
      }
    }
  },
  "revision": {
    "content": {
      "openapi": "3.1.0",
      "info": {
        "title": "Store QA Widgets API",
        "version": "2.0.0"
      },
      "paths": {}
    }
  },
  "consumerProfile": {
    "id": "store-qa-consumer",
    "version": "1",
    "minimumLevel": "WARN",
    "severityOverrides": {}
  },
  "waivers": [],
  "evaluationDate": "2026-09-16"
}' |
apify call ceddl/openapi-consumer-breakage-gate --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,ceddl/openapi-consumer-breakage-gate"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/VI3HbRNXEabJE0t6h/builds/fm9dBDAUvg6rwbcfx/openapi.json
