Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

schemathesis-fuzzing

БесплатноБез исполняемых скриптовНе проверен

Use for any request to generate API tests from an OpenAPI or GraphQL schema, or to find inputs that make an API return 500 that hand-written tests miss…

testlandот testland★ 18 звёзд на GitHub

Об этом скилле

schemathesis-fuzzing

Overview

Schemathesis is a property-based API testing tool that "automatically generates property-based tests from your OpenAPI or GraphQL schema and exercises the edge cases that break your API" (schemathesis-readme). The schema is the single source of truth - every endpoint, parameter, and response shape becomes a generator that produces hundreds of targeted variations per run.

This is complementary to example-based API testing (postman-collections, tavern-testing, restassured-testing, karate-testing) - example-based tests verify happy paths; Schemathesis attacks the boundaries the team forgot.

When to use

  • The repo has an OpenAPI 2.0 / 3.0 / 3.1 / 3.2 spec or a GraphQL schema (June 2018+).
  • The team wants automatic test coverage of new endpoints without authoring per-endpoint tests.
  • Negative-scenario coverage ("what happens with a malformed request?") is missing or thin.
  • A CI gate on 5xx responses (any unexpected server error) is desired.

If the API has no schema, Schemathesis cannot help - generate a schema first (FastAPI, Flask-Smorest, NestJS Swagger, dropwizard, or hand-author a spec), then return.

How to use

  1. Confirm the API ships an OpenAPI 2/3.x or GraphQL schema (see When to use).
  2. Install the CLI (pip install schemathesis, or uvx for a one-off run).
  3. Run schemathesis run <schema> against staging with the default checks; reproduce any failure from the printed curl command + Hypothesis seed.
  4. Promote it to a first-class pytest test (@schema.parametrize()) and gate CI on schema-conformance + 5xx detection - deep CI wiring and advanced auth hooks live in references/ci-and-pytest-integration.md.

Install

pip install schemathesis

(Per schemathesis-readme.)

For the latest CLI without modifying the project's Python env:

uvx schemathesis run <schema-url>

(Adapted from schemathesis-docs - uvx is the uv runner for one-off tool execution.)

Running via CLI

Basic invocation per schemathesis-readme:

schemathesis run <schema-url>

<schema-url> can be:

  • Remote URL: https://api.example.com/openapi.json.
  • Local file: ./openapi.yaml.

Key flags

Per the CLI reference (Schemathesis 4):

Flag Purpose
-u, --url <url> API base URL (test against staging vs prod); required for a file-based schema.
-c, --checks <a,b> Comma-separated checks to run; the default is all checks.
-n, --max-examples <N> Number of generated cases per operation.
-w, --workers <N|auto> Parallel workers (1-64 or auto); speeds up large schemas.
-H, --header 'X-API-KEY: ...' Inject a header on every generated request (repeatable).
-a, --auth user:pass HTTP Basic Auth.
--report junit,har,vcr Write reports (default directory schemathesis-report); paths via --report-junit-path, --report-har-path, --report-vcr-path.

The 3.x flags --base-url, --hypothesis-max-examples, --junit-xml and --cassette-path are not in the current CLI (cli); old blog posts and CI files still use them.

Worked example

schemathesis run https://api.example.com/openapi.json \
  --url https://staging.example.com \
  --max-examples 200 \
  --workers 4 \
  --header "Authorization: Bearer $API_TOKEN"

Built-in checks

Per schemathesis-readme and the [checks reference][checks], the main checks ("All checks are enabled by default unless explicitly disabled"; only max_response_time is off until you set --max-response-time):

Check What it verifies
status_code_conformance Response status code is one of the codes documented in the schema for that endpoint.
response_schema_conformance Response body matches the documented schema (types, required fields, enum values).
content_type_conformance Content-Type header is one of the schema's documented media types.
response_headers_conformance Response headers conform to the schema's headers declaration.
not_a_server_error The response is not in the 5xx range; any 5xx is a hard fail.
negative_data_rejection Invalid input (outside the schem
Полный SKILL.md на GitHub

Установить schemathesis-fuzzing в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

.tessl-plugin/plugin.jsonevals/41-of-44-operations-red-two-days-before-release/criteria.jsonevals/41-of-44-operations-red-two-days-before-release/task.mdevals/cart-cases-come-back-401-and-404/criteria.jsonevals/cart-cases-come-back-401-and-404/task.mdevals/deadline-pr-retargets-the-run-at-the-live-api/criteria.jsonevals/deadline-pr-retargets-the-run-at-the-live-api/task.mdevals/ninety-green-nights-and-a-coverage-questionnaire/criteria.jsonevals/ninety-green-nights-and-a-coverage-questionnaire/task.mdevals/schemathesis-auth-negative/criteria.jsonevals/schemathesis-auth-negative/task.mdevals/schemathesis-stateful-links/criteria.jsonevals/schemathesis-stateful-links/task.mdevals/schemathesis-v4/criteria.jsonevals/schemathesis-v4/task.mdevals/support-500s-the-nightly-run-never-saw/criteria.jsonevals/support-500s-the-nightly-run-never-saw/task.mdreferences/ci-and-pytest-integration.md

FAQ

Что делает скилл schemathesis-fuzzing?

Use for any request to generate API tests from an OpenAPI or GraphQL schema, or to find inputs that make an API return 500 that hand-written tests miss: Schemathesis fuzzes every endpoint for 5xx errors and schema violations from the CLI or pytest, picks the conformance checks and gates CI as the API evolves.

Как установить скилл schemathesis-fuzzing?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл schemathesis-fuzzing запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить schemathesis-fuzzing с