The OpenAPI specification
On This Lesson 4 topics
This lesson is planned. The outline below lists the topics it will cover. The full lesson has not been published yet.
In this lesson
read an OpenAPI document.
Planned topics
- OpenAPI is a standard, machine-readable description of an HTTP API, written in YAML or JSON.
infonames the API and its version.serverslists base URLs.pathslists URLs; each path has operations (get,post, ...).- An operation lists parameters, a request body, and
responsesby status code. - Reusable shapes live in
components/schemasand are referenced with$ref.
Draft outline details
Demonstration
openapi: 3.0.3
info: { title: Shop API, version: 1.0.0 }
paths:
/products/{id}:
get:
parameters:
- { name: id, in: path, required: true, schema: { type: integer } }
responses:
"200": { description: OK }
"404": { description: Not found }Check your understanding
Where do reusable schemas live?
Show answer
Under components/schemas.
Practice
Apply this lesson with the module's lab, exercises and quiz.
Marking a lesson complete is optional and you can undo it any time. Your progress stays in this browser.