{
  "openapi": "3.1.0",
  "info": {
    "title": "Example Notes API",
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "https://api.example.test"
    }
  ],
  "paths": {
    "/notes/{id}": {
      "get": {
        "tags": [
          "Notes"
        ],
        "summary": "Get a note",
        "description": "Read a saved note from this fictional API.",
        "operationId": "getNote",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "examples": {
              "known-note": {
                "summary": "Known note ID",
                "value": "note_123"
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The saved note.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Note"
                },
                "examples": {
                  "saved": {
                    "summary": "Retrieved release note",
                    "value": {
                      "id": "note_123",
                      "text": "Review the release candidate.",
                      "createdAt": "2026-10-18T09:30:00Z",
                      "archivedAt": null,
                      "author": {
                        "id": "usr_42",
                        "displayName": "Morgan Lee"
                      },
                      "tags": [
                        "release",
                        "review"
                      ],
                      "metadata": {
                        "source": "release-checklist",
                        "pinned": true
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "No note has that ID.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "code",
                    "message"
                  ],
                  "properties": {
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Note": {
        "type": "object",
        "description": "A saved note with its author, labels, and display metadata.",
        "required": [
          "id",
          "text",
          "createdAt",
          "archivedAt",
          "author"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "The generated note ID."
          },
          "text": {
            "type": "string",
            "maxLength": 280,
            "description": "The saved text."
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "description": "When the note was created."
          },
          "archivedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the note was archived, or null while active."
          },
          "author": {
            "type": "object",
            "description": "The person who created the note.",
            "required": [
              "id",
              "displayName"
            ],
            "properties": {
              "id": {
                "type": "string",
                "description": "The author's user ID."
              },
              "displayName": {
                "type": "string",
                "description": "The author's display name."
              }
            }
          },
          "tags": {
            "type": "array",
            "description": "Labels used to organize the note.",
            "items": {
              "type": "string"
            }
          },
          "metadata": {
            "$ref": "#/components/schemas/NoteMetadata"
          }
        }
      },
      "NoteMetadata": {
        "type": "object",
        "description": "Optional display information for a note.",
        "properties": {
          "source": {
            "type": "string",
            "description": "Where the note came from."
          },
          "pinned": {
            "type": "boolean",
            "description": "Whether the note stays at the top."
          }
        }
      }
    }
  }
}
