skip to content

OpenAPI

OpenAPI describes an HTTP API as a document: operations, JSON Schema payloads, reusable components and security schemes. Interviewers ask because a spec makes a contract testable and generatable.

part ofAPI stylesoverview, primer and where to startread it →
on this pageshow

questions

page 2 of 2

How would you stop published OpenAPI documents from drifting away from the running services?

level: principalimportance: should knowfreq 26%

basics

~20 s

Make the document impossible to bypass: one generation path per service, a CI check that fails when the regenerated spec differs from the committed one, publication from the deploy pipeline rather than by hand, and runtime checks that responses still match the schemas.

open as a page

How do you decide whether to extract a schema into OpenAPI components or leave it inline?

level: principalimportance: should knowfreq 28%

basics

~20 s

Extract when several operations genuinely describe the same thing and should change together; leave it inline when the shape is incidental to one operation. A shared component is a coupling decision — every consumer of every referencing operation inherits its changes.

open as a page

showing 31–32 of 32