On this page4 sections
ReferenceBeginner4-6 min reference

OpenAPI / Swagger

An OpenAPI document (formerly "Swagger") is a machine-readable description of an API — paths, parameters, schemas, and responses. For QA it's a free test oracle: every required field, enum, and status code is the spec you assert against. This is a lookup of the structure and what to check; for schema-assertion mechanics see the API Schema Validation sheet linked below.

Document structure

KeyHolds
openapiSpec version (e.g. 3.1.0)
infoTitle, version of the API
serversBase URLs per environment
pathsEndpoints → operations (get, post, …)
components.schemasReusable data models
components.securitySchemesAuth (bearer, OAuth2, apiKey)

Inside an operation

FieldWhat QA reads from it
parameterspath/query/header params, required, types
requestBodypayload schema + required fields
responsesevery documented status code + body schema
requiredfields that must be present (negative tests)
enumthe only allowed values (boundary tests)
formatdate-time, email, uuid — validation rules
deprecatedflag if still in use

What QA verifies against the spec

  • Every documented status code is reachable (200, 201, 400, 401, 404, 422…).
  • Responses match the declared schema — no extra/missing fields, correct types.
  • required request fields actually rejected when omitted (→ 400/422).
  • enum values accepted; out-of-enum rejected.
  • The implementation hasn't drifted from the spec (a common bug source).

Common mistakes

  • Trusting the spec as truth — it can be out of date; test that code matches it.
  • Ignoring 2.0 (Swagger) vs 3.x differences (definitions vs components.schemas).
  • Testing only documented happy responses, never the documented error codes.
  • Not regenerating the spec in CI, so drift goes unnoticed.

// Related resources