More screenshots

    Works with the AI Agents you already use

    Claude CodeClaude CodeCursorCursorCodex CLICodex CLIMuseMuseDotsDots+21 more

    OpenAPI-to-Mock Test Harness Builder

    1

    Turn an OpenAPI spec into an executable local mock server, deterministic fixtures, constraint-derived negative tests, and an endpoint coverage report.

    $12

    Secure checkout via Stripe

    Money-back guarantee

    Converts to your local currency at checkout

    Security scanned
    OpenAPI-to-Mock Test Harness Builder

    OpenAPI-to-Mock Test Harness Builder

    Example session with this skill installed

    Build a local mock and contract-test harness from:

    openapi.yaml

    Requirements

    • parse the full OpenAPI document;
    • inventory every documented operation;
    • resolve local $ref references;
    • prefer explicit examples already present in the spec;
    • generate deterministic valid request and response fixtures when examples are missing;
    • generate negative cases from required fields, enums, primitive types, string constraints, numeric bounds, array constraints, and required parameters;
    • generate a local mock server for all documented routes;
    • include representative documented 4xx/5xx responses when available;
    • generate positive contract tests;
    • generate concrete negative tests where the schema provides enough information;
    • flag unresolved external references instead of inventing schemas;
    • do not call production APIs;
    • do not embed real credentials;
    • generate an endpoint coverage report;
    • run validation and tests when the local dependencies are available.

    Use the repository's existing API-test/mock stack if one is already configured. Otherwise, generate the default Python/FastAPI/pytest harness.

    • Read your context and instructions
    • Compiled the openapi-to-mock test harness

    OpenAPI mock/test harness complete

    OpenAPI version
    3.1.0

    API
    Commerce API

    Operations discovered
    42

    Success fixtures generated
    42

    Request fixtures generated
    27

    Documented error fixtures generated
    18

    Constraint-derived negative cases
    96

    Mock routes generated
    42

    Positive contract tests
    42

    Concrete negative tests
    71

    Manual-review negative cases
    25

    Unresolved references
    0

    Coverage summary

    Operations with success fixtures
    42 / 42

    Operations with positive tests
    42 / 42

    Operations with at least one negative case:
    34 / 42

    Operations with documented error fixtures
    18 / 42

    Operations requiring manual review
    5

    Harness coverage
    100% route generation
    81% operations with negative coverage

    This is harness coverage, not production code coverage.

    Example endpoint

    POST /customers

    Generated valid request

    {
      "name": "Example Customer",
      "email": "user@example.test",
      "plan": "pro"
    }
    

    Generated success fixture

    {
      "id": "00000000-0000-4000-8000-000000000001",
      "name": "Example Customer",
      "email": "user@example.test",
      "plan": "pro"
    }
    

    Constraint-derived tests

    email:

    • required field missing
    • wrong primitive type
    • invalid email format

    plan:

    • enum violation

    name:

    • below minLength
    • above maxLength

    Generated local server

    Run

    python -m pip install -r requirements.generated.txt
    uvicorn mock_server.app:app --reload --port 4010

    Mock URL

    http://localhost:4010

    Example generated test

    def test_create_customer_happy_path():
        response = client.post(
            "/customers",
            json={
                "name": "Example Customer",
                "email": "user@example.test",
                "plan": "pro"
            },
        )
    
    assert response.status_code == 201
    

    Example negative test

    def test_create_customer_missing_email():
        payload = {
            "name": "Example Customer",
            "plan": "pro"
        }
    
    response = client.post("/customers", json=payload)
    
    assert response.status_code in {400, 422}
    

    Files generated

    • api_inventory.json
    • fixtures/
    • negative_cases.json
    • mock_server/app.py
    • tests/test_contracts.py
    • requirements.generated.txt
    • coverage_report.json
    • validation_report.md
    • README.generated.md

    Validation
    Fixture JSON parsing: PASS
    Local reference resolution: PASS
    Mock server import: PASS
    Contract tests: PASS

    This harness validates the generated mock contract against the OpenAPI document. It does not prove that the production backend implements the same behavior unless the same contract tests are also run against that backend.

    api_inventory.json

    Connects securely to your tools. The creator never sees your data.

    About this skill

    Manual API testing and mock creation waste hours of developer time, especially when the spec changes. This skill automates the generation of an executable test harness directly from your OpenAPI 3.x definitions. It produces more than just documentation, it builds a functional sandbox for frontend development and a rigorous contract testing suite for the backend.

    What it does

    • Parse specifications Validates and inventories all paths, operations, and schemas from your OpenAPI YAML or JSON files.
    • Generate fixtures Derives deterministic valid data from examples, enums, and schema constraints to use in tests.
    • Derive negative cases Automatically identifies boundary violations like missing required fields, type mismatches, and range errors.
    • Build mock servers Scaffolds a Python FastAPI and Uvicorn server that serves your fixtures locally.
    • Create contract tests Generates a pytest suite to verify that your implementation matches the documented request and response shapes.
    • Report coverage Produces a detailed inventory of operations, fixtures, and test coverage to identify gaps in your API design.

    How it works

    1. Inventory The agent scans your openapi.yaml to map all endpoints, parameters, and response codes.
    2. Fixture derivation It extracts values from example tags or generates them based on minLength, maximum, and other constraints.
    3. Harness generation The agent writes the FastAPI mock server, the pytest files, and the api_inventory.json.
    4. Validation It validates the generated JSON against the original schemas to ensure the harness itself is compliant.

    Frameworks & tools

    Built for Python environments using FastAPI, Uvicorn, pytest, httpx, and jsonschema. It supports OpenAPI 3.x specifications in both YAML and JSON formats.

    Why this beats prompting it yourself

    Generic prompts often produce hallucinated examples or ignore schema constraints like multipleOf or pattern. This skill follows a strict resolution priority and deterministic generation logic to ensure your mocks and tests actually match the contract every time.

    Use cases

    • Accelerate frontend development by providing a local mock server before the backend exists.
    • Detect breaking changes in API updates by running generated contract tests against the new spec.
    • Generate exhaustive negative test cases to improve backend input validation.
    • Audit existing OpenAPI files for missing examples or incomplete schema definitions.

    Known limitations

    Does not support external $ref links that require remote authentication. Requires a Python environment with PyYAML for YAML processing. Does not verify production business logic beyond the schema.

    Requires Python environment for FastAPI/pytest. Limited support for remote/unauthenticated external $ref. Does not verify business logic, only schema compliance.

    How to use

    1. 1

      Connect your agent to the Agensi MCP

      Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup

    2. 2

      Sign in to Agensi

      Your agent shows a sign-in link. Sign in and click Allow.

    3. 3

      Ask for what you need

      Your agent loads this skill and uses it on your task. It always asks before any payment.

    Reviews

    No reviews yet

    Be one of the first to try it. Every listed skill goes through the trust checks below.

    Security scanned

    Checked by our 8-point scan before listing

    Fresh listing

    Recently published to Agensi

    Money-back guarantee

    Doesn't do what its page promises? You get your money back.

    Trust & safety

    Security scan

    Security scan passed 1 month ago

    Requires

    Example
    Python

    Permissions

    Terminal / Shell
    Network Access

    Allowed Hosts

    example.test
    Listed1 month ago
    Updated23 days ago

    What's inside

    Frequently Asked Questions

    This skill generates a complete Python-based FastAPI mock server and a pytest suite directly from your OpenAPI 3.x file, automating the manual work of creating sandboxes and contract tests. It solves the problem of "stale" mocks by ensuring your local test environment always matches your latest API specification.

    The skill is optimized for AI agents with file-system access and Python execution capabilities, such as AutoGPT or custom GPTs with Code Interpreter. It requires a local Python environment with libraries like FastAPI and pytest to run the generated harness.

    Beyond valid data, the skill analyzes schema constraints like `minLength`, `pattern`, and `required` fields to automatically generate edge-case tests. These negative tests help you identify if your backend properly rejects invalid inputs before you even write a line of code.

    You receive the core agentic logic for parsing and generation, along with a set of templates for the FastAPI server and pytest configurations. It also includes the logic for creating the `api_inventory.json` coverage report to track your testing progress.

    While it excels at validating the "contract" (shapes, types, and constraints), it does not verify internal business logic, such as database state or complex multi-step workflows. It is designed to ensure your API's front door matches your documentation perfectly.

    New in Testing & Debugging