API Documentation & Specification Flashcards
6 cards from real API practice questions. Tap to flip, then mark Knew It or Still Learning — missed cards come back until you master them.
Read the first 6 API Documentation & Specification flashcards as text
What does 'spec-based testing' mean in API quality assurance?
Answer: Generating and running tests automatically from the OpenAPI specification
Spec-based testing uses the OpenAPI specification to auto-generate test cases, validating that the implementation matches the declared contract.
Which tool uses an OpenAPI or API Blueprint spec to run contract tests against a live API?
Answer: Dredd
Dredd is an open-source HTTP API testing framework that validates a live API against its OpenAPI or API Blueprint specification document.
What is the purpose of the 'servers' section in an OpenAPI 3.0 specification?
Answer: Define the base URLs where the API is hosted (e.g., production, staging)
The 'servers' section declares the base URLs for different environments (production, staging, sandbox), allowing tools to direct requests appropriately.
What does 'changelog' maintenance mean in the context of API documentation best practices?
Answer: Documenting every breaking and non-breaking change between API versions
An API changelog records what changed between versions — new endpoints, deprecated fields, breaking changes — helping consumers know what to update.
What is the 'discriminator' keyword used for in OpenAPI polymorphism?
Answer: Indicate which sub-schema to use when a field's value determines the object type
The 'discriminator' property in OpenAPI enables polymorphism by specifying which field's value determines which schema variant (oneOf/anyOf) should be applied.
Which HTTP header is used by APIs to indicate which version is being served?
Answer: X-API-Version or a custom versioning header
Custom headers like X-API-Version or response headers indicating the current API version allow clients to detect which version they are communicating with.