The OpenAPI specification
In large-scale systems, the definition of a REST API, and what data is returned by each endpoint, needs to be used in various ways. Take documentation for example. A public REST API needs to have each of its endpoints listed in a formal document, and this document also needs to define the type of each property, as well as the constraints of each property. As an example of these constraints, consider a POST call to an endpoint. If our endpoint defines a property of type number, then how does the user of this endpoint know what the upper and lower limits of this number are? Is it a 32-bit number, or a 64-bit number? Is it signed or unsigned? If the endpoint defines a string property, then how many characters are allowed? ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access