Skip to content
Ameen Abozaid
Planned lessonJNR-021-L01

The OpenAPI specification

  • Lesson 1 of 5
  • Junior
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.
  • info names the API and its version. servers lists base URLs.
  • paths lists URLs; each path has operations (get, post, ...).
  • An operation lists parameters, a request body, and responses by status code.
  • Reusable shapes live in components/schemas and are referenced with $ref.
Draft outline details

Demonstration

yaml
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.

Lab and exercises Quiz

Marking a lesson complete is optional and you can undo it any time. Your progress stays in this browser.

Continue to next lesson

Type to search levels, phases, modules and lessons.