A complete small OpenAPI JSON contract beside valid and invalid limit examples

HTML for this example

Select the code and use your copy shortcut. Changes in this preview are temporary.

<!doctype html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><meta http-equiv="Content-Security-Policy" content="default-src 'none'; style-src 'unsafe-inline'; form-action 'none'; base-uri 'none'"><title>Shelf Catalog · contract review</title><style>*{box-sizing:border-box}body{margin:0;font:16px/1.5 Arial,Helvetica,sans-serif;color:#24313b;background:#fff}main{max-width:900px;margin:auto;padding:22px}h1{font-size:26px;line-height:1.2;margin:8px 0 18px}h2{font-size:19px;margin:22px 0 10px}h3{font-size:17px;margin:14px 0 8px}p{margin:10px 0}ul,ol{padding-left:22px}li{margin:6px 0}.note{font-size:13px;color:#53616a}.callout{border-left:4px solid #405d73;background:#f2f5f7;padding:10px 14px}table{border-collapse:collapse;width:100%;margin:12px 0}caption{text-align:left;font-weight:bold;padding:0 0 8px}th,td{padding:9px 8px;text-align:left;vertical-align:top;border-bottom:1px solid #b8c3ca;overflow-wrap:anywhere}th{background:#edf2f5}td b{display:none}footer{border-top:1px solid #aeb9bf;margin-top:22px;padding-top:12px}pre{white-space:pre-wrap;overflow-wrap:anywhere;font:16px/1.5 ui-monospace,monospace;background:#f5f5f5;padding:12px}@media(max-width:560px){main{padding:16px}h1{font-size:23px}thead{display:none}table,tbody,tr,td{display:block;width:100%}caption{display:block}tr{border-bottom:1px solid #aeb9bf;padding:6px 0}td{border:0;padding:3px 0}td b{display:inline}}@media print{@page{size:letter;margin:.5in}main{padding:0}}.contract{border-top:3px solid #40566e}</style></head><body><main><p class="note">Original fictional OpenAPI contract · no deployed service</p><h1>Shelf Catalog · contract review</h1><h2>GET /books · limit rule</h2><p>Optional integer limit:1–50; default10. Public-read operation in this example only.</p><p>Valid:<code>/books?limit=2</code>. Invalid:<code>/books?limit=0</code>, below minimum1. No requests sent.</p><section class="contract"><h2>Complete OpenAPI3.1.0 JSON</h2><pre data-spec>{
  "openapi": "3.1.0",
  "info": {
    "title": "Shelf Catalog (fictional)",
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "https://api.example.invalid/v1"
    }
  ],
  "security": [],
  "paths": {
    "/books": {
      "get": {
        "operationId": "listBooks",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 50,
              "default": 10
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Book list",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BookList"
                },
                "example": {
                  "items": [
                    {
                      "id": "b1",
                      "title": "Example One"
                    },
                    {
                      "id": "b2",
                      "title": "Example Two"
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid limit",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "error": "limit must be an integer from 1 to 50"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Book": {
        "type": "object",
        "required": [
          "id",
          "title"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "title": {
            "type": "string"
          }
        }
      },
      "BookList": {
        "type": "object",
        "required": [
          "items"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Book"
            }
          }
        }
      }
    }
  }
}</pre></section><h2>Checks still required</h2><p>Repository authority, actual access policy, rate limits and migration:[TO CONFIRM]. Local JSON/reference checks do not establish external-validator approval or server conformance.</p><footer>Copy by selecting code. No backend, request runner or fake copy control. Keep the repository contract authoritative.</footer></main></body></html>