pypi schemathesis 4.34.0
Release 4.34.0

one hour ago

🚀 Added

  • Testing Open API 3.2 additionalOperations with custom methods like COPY or PURGE.
  • Open API 3.2 request body examples given as serializedValue.
  • Request bodies for application/jsonl, x-ndjson and json-seq, sent as one JSON record per line.
  • Array bodies for multipart/mixed and other non-form multipart types sent as ordered parts.
  • Open API 3.2 itemSchema for multipart/mixed and other non-form multipart request bodies.
  • Request bodies for text/event-stream, sent as one event per item, including Open API 3.2 itemSchema.
  • XML request bodies place children of nodeType: none objects directly in the parent element.
  • Error feedback learns integer, hex and ObjectId formats from Java and MongoDB parse errors.
  • --app option and app config key test Python ASGI and WSGI applications without a server.
  • from-operation dictionaries fill from Open API and GraphQL responses, keeping parent and child IDs paired. #5751
  • setup and teardown hooks run once around testing in st run, st fuzz and pytest.
  • @schemathesis.extension registers a hook class with its own [extensions.<name>] settings.
  • schemathesis.scoped_extensions() removes hooks, auth providers and other extensions registered inside a block.
  • hooks config option accepts a list of modules, loaded in order.
  • generation.allow-whole-floats config option to stop sending integers in JSON bodies as floats (2.0).
  • Case.reapply_auth() refreshes expired auth tokens on cases generated earlier, honoring refresh_interval.

🏎️ Performance

  • Up to 6x faster data generation for patterns with Unicode-wide classes like [\P{M}\p{M}].
  • Up to 13% faster negative coverage phase against fast local APIs.
  • Up to 2x faster GraphQL test case generation in negative mode.

🔧 Changed

  • st fuzz probes API capabilities and runs sign-up before fuzzing, like st run.
  • One setup phase replaces probing, schema_analysis and auth_bootstrap in NDJSON reports.
  • Custom format values in path parameters are sent as is, with % encoded as %25.
  • Check failures from call_and_validate() and validate_response() are AssertionErrors, so except Exception catches them.
  • Output sanitization masks Cookie and Set-Cookie headers per cookie name, keeping non-sensitive cookies visible.

🐛 Fixed

Schema loading

  • Path parameter names containing ., :, ! or [ failing to load.
  • Unresolvable remote references written as relative paths reported as missing files.
  • schema.app unset in after_load_schema hooks for from_asgi and from_wsgi schemas.
  • Open API 3.2 references to the $self URI, or relative to it, failing to resolve.

Reporting

  • Reject two CLI report formats targeting the same output file.
  • Crash in HAR reports when the base URL contains credentials.
  • Mask sensitive parameters in meta.raw_containers of NDJSON reports and crash files.
  • Lost or misattributed pytest report entries for stateful tests and calls to other operations.
  • Missing Open API 3.2 query operations in the WFC report.
  • WFC report faults for undeclared methods naming operations missing from endpointIds.
  • HAR, VCR and WFC reports created or overwritten by runs refused before testing starts.
  • --report dropping output paths set in [reports.<format>].
  • Record schema loading errors in JUnit reports as an errored test case.
  • HookExecutionError in pytest reports when tests validate responses from their own HTTP client.
  • st fuzz counting a scenario as passed when the time limit cuts its only request.
  • ModuleNotFoundError for allure_commons in pytest reports when allure-pytest is not installed.
  • Mask apiKey security scheme credentials in output whatever their header, query or cookie name.
  • Mask credentials in repr(case) following output.sanitization, like the cURL reproduction command.
  • Mask sensitive query parameters in network error messages, like the cURL reproduction command.
  • Keep URL credentials out of network error messages, crash files and st replay output.
  • <BINARY> shown for text responses cut mid-character by max-recorded-payload-size.

Request serialization

  • Serialization error for multipart parts with image/jpg and other content types without a serializer.
  • multipart/form-data array properties with non-string items sent as a single part.
  • Unwrapped XML arrays naming their items after the array's own xml.name.
  • Missing application/octet-stream part Content-Type for binary, contentEncoding and untyped multipart fields.
  • Generated path values with %XX sent decoded, e.g. a%41 as aA or %e0 as U+FFFD.

Data generation

  • Internal error for dictionaries bound to parameters whose schema references a shared component.
  • Schema error for pattern with escaped }/] or classes like [\P{M}\p{M}], combined with minLength/maxLength. #6137
  • False positive negative_data_rejection for unmapped discriminator values under defaultMapping.
  • Missing discriminator mapping values written as schema names in generated data.
  • Truncated discriminator values for whole-file $ref branches with dotted names, like Pet.Cat.json.
  • Keep constants from hooks files and other local modules out of generated data.

Coverage phase

  • Skipping the valid request when an earlier case fails.
  • Oversized strings that crash the server cutting off coverage cases of later operations.
  • TypeError in the coverage phase for schemas with non-array examples.
  • Internal error for format beside a pattern with an oversized quantifier like ^a{100000}$.
  • Missing positive values when minLength exceeds what an unanchored pattern matches. #6085
  • False positive positive_data_acceptance for optional parameters whose schema admits no value. #6085
  • Valid oneOf parameter values sent as negative test cases, e.g. 0 for an integer-or-string id.

Checks and response validation

  • False positive ignored_auth for operations accepting OAuth 2 or OpenID Connect tokens alongside other schemes.
  • False positive ignored_auth for credentials passed via auth or session.auth.
  • Report after_run checks skipped when --max-failures or an interrupt stops st run.
  • False positive negative_data_rejection for empty multipart/mixed array bodies.
  • False positive ensure_resource_availability for request bodies not set by a link. #6178
  • Internal error in positive_data_acceptance for rejected bodies with undeclared properties and a malformed schema. #6118
  • --checks enabling max_response_time with a 10-second limit, or disabling a configured one.
  • List failures in the same order on every run, in the CLI and validate_response() errors.
  • Report header, body and SSE payload schema violations at the same schema path separately.

Inferred links

  • Links filling path, query or header parameters with object or array fields, e.g. productId: {...}.
  • Links filling runner_id with the id of another resource named after it, like a runner group.

gRPC

  • Report gRPC UNAVAILABLE statuses from slow-to-connect servers as responses, not network errors.

st replay

  • Crash files deleted or replayed against the wrong schema after a run against another API.

CLI and configuration

  • Command-line options losing to [[operations]] and [phases] settings in the configuration file.
  • Runs ending in authentication errors when the --auth-wfc login endpoint starts after the API.
  • Internal error or ignored Ctrl-C when interrupting st run and st fuzz.
  • st explain ST112 suggesting --exclude-checks max_response_time, which st run rejects.
  • Baseline of the matching [[project]] ignored by the run summary, --baseline-update and --baseline-prune.
  • Login-based auth dropping still-valid credentials when a re-login fails, and hiding the login error.
  • Shrink st run failures to a minimal example, so --no-shrink takes effect.
  • Stop schemathesis.toml discovery at the root of a git worktree or submodule.
  • UnicodeEncodeError in CLI output on non-UTF-8 streams, such as piped output on Windows.

pytest and Python API

  • Shrink failing inputs to a minimal example in pytest, Hypothesis and stateful tests.
  • Show argument values in failing examples of other Hypothesis tests run alongside Schemathesis.
  • AttributeError in validate_response() for unsupported response types.
  • ASGI applications receiving requests before lifespan startup completes when tested with several workers.
  • Replay expired-token requests with fresh credentials from per-test and as_strategy() auth providers.
  • Honor retry_on of per-test and as_strategy() auth providers, retrying 401 responses by default.

Don't miss a new schemathesis release

NewReleases is sending notifications on new releases.