OpenAPI Spec example

This page shows the Markdown front matter and a short OpenAPI document. MDU generates the reference below from the same YAML file.

The Markdown page uses this front matter:

---
title: Orders API
openapi: ./openapi-example.yaml
---

The referenced openapi-example.yaml contains one endpoint and its response schema:

openapi: 3.1.0
info:
  title: Orders API
  version: 1.0.0
paths:
  /orders/{id}:
    get:
      tags: [Orders]
      summary: Get an order
      parameters:
        - name: id
          in: path
          required: true
          schema: { type: string }
      responses:
        '200':
          description: Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Order'
components:
  schemas:
    Order:
      type: object
      required: [id, status]
      properties:
        id: { type: string }
        status:
          type: string
          enum: [pending, shipped]

Generated reference

API overview

Orders API

Version 1.0.0

Orders1
GET /orders/{id}Get an order

Path Parameters

Parameter Description
id: string
Response 1 of 1

Found

Media Type 1 of 1

Order

{
  "id": "string",
  "status": "pending"
}
Last updated on

Search documentation

Press Esc to close

Start typing to search the documentation.

Media settings

Choose which providers may load videos automatically across this site. Your choices are stored in this browser.