API StudioSDK StudioMonitoringMCP ServerSpec AuditFeatures
PricingBlogDocs
Log inStart for free
Blog/Engineering
Engineering·October 15, 2026·3 min read

Your OpenAPI spec can generate bug reports, too

Use schema-driven and stateful tests to explore API behavior. Preserve minimized failures and add business invariants the schema cannot express.

#openapi#api-testing#property-based-testing#ci
Your OpenAPI spec can generate bug reports, too

A schema limits a field to 40 characters. A test generator can send shorter values, a value at the limit and values beyond it, then check the responses against the contract. The same approach can explore numeric bounds, missing fields and combinations a hand-written example never exercises.

Schema-driven testing turns those constraints into test inputs. Property-based testing explores many inputs against defined checks, while stateful testing can connect related operations. Save failures as request sequences that a developer can rerun.

Start with an isolated target

Use a disposable test environment, synthetic fixtures and restricted credentials. Generated requests can create, modify or delete resources when the exposed operations allow it. Review the operation surface and apply explicit limits before running a broad test campaign.

Pin the schema revision and record the service build. A bug report needs to identify both the contract and implementation under test. If either changes during the run, keep that fact with the result.

Schemathesis is one tool that generates tests from API schemas. Its stateful testing documentation explains how relationships between operations can support workflows. Check supported schema versions and CLI options for the version you install.

Test properties, not only examples

A schema can help generate values near declared boundaries: string lengths, numeric ranges, required fields, enum alternatives and nested objects. Negative testing can exercise rejection of invalid input where the tool supports it.

Check response schema conformance, content types and status codes. For invalid inputs, check the documented rejection and look for unhandled server errors.

Schema conformance is useful but incomplete. An API can return a valid order object with the wrong total. Add business invariants that the schema cannot express, using synthetic values whose expected behavior is known.

Connect operations when state matters

Creating a resource and then retrieving its returned identifier exercises behavior that an isolated GET cannot. OpenAPI links and supported inference mechanisms can help a runner discover these relationships.

Check the relationships the tool actually selected. A generated workflow still needs valid authentication, appropriate fixtures and correct ownership. A missing dependency may be a limitation of the test setup rather than an application bug.

Use fresh namespaces or resettable state between runs. Otherwise an existing resource can make a broken creation path appear successful, and parallel runs can interfere with each other's cleanup.

Keep a small reproducer

When a tool finds a failure, retain a minimal request sequence, sanitized response, relevant headers, schema revision and service build. Where shrinking or minimization is available, use it to reduce noise while preserving the failure.

Review the result before labeling it a server defect. The schema may be inaccurate, the generated value may exercise an undocumented assumption, or the environment may have been unavailable. Each is actionable, but they call for different fixes.

Convert confirmed failures into focused regression tests. A saved example makes the bug easy to revisit even if future random generation chooses different cases. Keep the broader campaign for discovering new problems.

Correct the contract when a test fails

When a failure reveals an incorrect response description or missing constraint, update the specification and verify the implementation. That improves downstream documentation and generated clients as well as the test campaign.

← PreviousHow to Choose an OpenAPI SDK Generator: 10 Questions to Ask

Related articles

Can an AI agent actually integrate your API? Build an eval to find out
Engineering·2 min read

Can an AI agent actually integrate your API? Build an eval to find out

Give an agent a real task, an isolated sandbox and a result you can verify. Check the records and code the agent produces.

October 15, 2026
MCP or CLI? Run the same API workflow through both
Engineering·2 min read

MCP or CLI? Run the same API workflow through both

Compare agent interfaces with the same task, permissions and outcome checks. Token counts mean little when one path does less work.

October 15, 2026
Your streaming API returned 200. Then it failed
Engineering·2 min read

Your streaming API returned 200. Then it failed

An HTTP success status starts a stream; it does not prove the operation finished. Design explicit completion, interruption and recovery semantics.

October 15, 2026
Who built this SDK? Proving package provenance from spec to registry
Engineering·2 min read

Who built this SDK? Proving package provenance from spec to registry

Connect a published SDK to its inputs and build workflow. Understand what trusted publishing and provenance establish, and what still needs review.

October 15, 2026

A letter when something ships

New SDK languages, changes in the generator, and now and then a longer piece on keeping docs from rotting. Roughly one a month.

Join developers keeping tabs on Octri.

Octri

Upload an OpenAPI spec. Get complete docs and production-ready SDKs in 10 languages, live in minutes.

Contact support

Product

  • API Studio
  • SDK Studio
  • Monitoring
  • MCP Server
  • Pricing
  • Open Source
  • Blog
  • Changelog
  • Press Kit

From your spec

  • Spec Audit
  • TypeScript SDK
  • Python SDK
  • Go SDK
  • Java SDK
  • MCP Server

Developers

  • Documentation
  • SDK Libraries
  • MCP Server
  • Monitoring
  • CLI
  • Support

Legal

  • Terms of Service
  • Privacy Policy
  • Fair Use Policy
  • Data Processing (DPA)
  • Cookie Policy
  • Security
  • Subprocessors

© 2026 Octri, LLC. All rights reserved.

Made by devs who got tired of hand-writing SDKs.