OpenAPI → Test Cases

Runs in browser Automation

Parse the spec and produce test cases per operation: happy path, missing required fields, invalid types, boundary values, unauthorised access and unexpected status codes — exportable as CSV, Markdown or JSON.

Privacy: This tool runs entirely in your browser. Your input never leaves your device.
Loading tool…

What is API contract testing?

An API contract is the agreed description of an interface — its endpoints, parameters, request and response schemas and status codes — usually written as an OpenAPI document. Contract testing compares what a service actually returns with that description, so a renamed field or a changed type is caught by the producer or the consumer before it breaks the other side.

Read the guide: What is API Testing? How to Test a REST API

How to use OpenAPI → Test Cases

  1. Paste the specification (or load the example).
  2. Optionally filter to specific operations and pick the categories you want.
  3. Choose the export format and generate.
  4. Review the table, then copy or download the export for your test-management tool.

OpenAPI → Test Cases features

  • Parses OpenAPI 3.x and Swagger 2.0 in JSON or YAML, resolving local $refs
  • Generates happy-path, missing-required, invalid-type, boundary, auth, not-found, documented-error, method and content-type cases per operation
  • Example requests with realistic synthetic values for path/query parameters and bodies
  • Priorities, preconditions, steps, expected status and expected result on every case
  • Filter by operation and category; export as Markdown, JSON or CSV

OpenAPI → Test Cases example

Create-book endpoint

Input:

Loaded example, filter "POST /books": required body { title (1–200 chars), isbn (^[0-9]{13}$), price 0–10000 }, bearer security, documented 201 and 409

Output:

24 cases, including:
TC-001 Create a book — valid request succeeds (201)
TC-003 Create a book — body without required field "title" (400)
TC-008 Create a book — wrong type for body field "price" (number → "abc") (400)
TC-017 Create a book — body "price" at below minimum (-1) (400)
TC-019 Create a book — no credentials (401)
TC-022 Create a book — documented 409: ISBN already exists (409)

Frequently asked questions about OpenAPI → Test Cases

What test cases are generated?

Per operation: happy path, optional parameters omitted, missing required parameters and body fields, invalid types, boundary values (min/max, length, item counts), unauthenticated/forbidden access, unknown ids (404), documented error statuses, unsupported methods (405) and unsupported content types (415).

Can I focus on one operation?

Yes — filter by method, path, operationId, summary or tag (e.g. "POST /books" or "createBook"), and choose the categories you need.

Which formats can I export?

Markdown (ready for a wiki or PR), JSON (for tooling) and CSV (for spreadsheets or test-management import). The table can also be downloaded as CSV.

Does it support Swagger 2.0?

Yes. Swagger 2.0 body parameters, definitions and securityDefinitions are handled alongside OpenAPI 3.x.

Technical notes

Boundary cases are derived from minimum/maximum, exclusive bounds, minLength/maxLength and maxItems; when a numeric field has no bounds, zero, negative and very large values are proposed, and a plain string body field gets an empty and a 10,000-character value. pattern is not used to derive cases, and at most eight boundary cases are generated per operation, in field order. Security is read from operation-level or global security requirements.

References

  • OpenAPI SpecificationOpenAPI InitiativeThe standard for describing REST APIs: paths, operations, parameters, schemas, responses and security schemes.
  • JSON Schema SpecificationJSON SchemaThe vocabulary for describing and validating the shape of JSON documents (types, required properties, formats).
  • RFC 9110: HTTP SemanticsIETF · 2022The meaning of HTTP methods, header fields, status codes and content negotiation, independent of the wire version.