Example brief: “Generate response flows and a shared-schema overview from the supplied OpenAPI contract.”
Imported from OpenAPI · 2026-09-14. The source passes chiltepin check. System details and measurements are illustrative; review them before adapting this document.
Reproduce this import
The import shows response flows and shared schemas. Response arrows list alternative outcomes. The source contract contains the parameters and request-body details.
Download the OpenAPI source, then run:
npx chiltepin@latest sync openapi library-api.openapi.json --slug library-api --out library-api.md
npx chiltepin@latest check library-api.md
npx chiltepin@latest sync openapi library-api.openapi.json --slug library-api --check library-api.md
Change the source contract and run the last command again to detect differences. Regenerate with --out library-api.md --force when you intend to replace the generated file. This site checks the committed source and generated document during every build.
View the Markdown
```meta
title: "Library catalogue API"
subtitle: "Illustrative API contract for the Chiltepin import example. No service is deployed at the example URL."
tag: "API · v1.0.0"
```
## Overview
Illustrative API contract for the Chiltepin import example. No service is deployed at the example URL.
## Endpoints
```table
columns: [Method, Path, Summary]
rows:
- [GET, "/books", "Search the catalogue"]
- [GET, "/books/{bookId}", "Read a book and its availability"]
- [POST, "/holds", "Request a hold at Central Library"]
```
## GET /books
```sequence
id: library-api-get-books
title: "Search the catalogue"
endpoint: { method: GET, path: "/books" }
actors:
- { id: Client, name: Client }
- { id: API, name: API }
messages:
- { from: Client, to: API, label: "GET /books", kind: sync }
- { from: API, to: Client, label: "200 Matching books", kind: response }
```
## GET /books/{bookId}
```sequence
id: library-api-get-books-bookid
title: "Read a book and its availability"
endpoint: { method: GET, path: "/books/{bookId}" }
actors:
- { id: Client, name: Client }
- { id: API, name: API }
messages:
- { from: Client, to: API, label: "GET /books/{bookId}", kind: sync }
- { from: API, to: Client, label: "200 The requested book", kind: response }
- { from: API, to: Client, label: "404 No book has this identifier", kind: error }
```
## POST /holds
```sequence
id: library-api-post-holds
title: "Request a hold at Central Library"
description: "This fixture only models the request contract. Authentication and circulation rules belong in the real service specification."
endpoint: { method: POST, path: "/holds" }
actors:
- { id: Client, name: Client }
- { id: API, name: API }
messages:
- { from: Client, to: API, label: "POST /holds", kind: sync }
- { from: API, to: Client, label: "201 Hold recorded", kind: response }
- { from: API, to: Client, label: "409 No copy can currently be held", kind: error }
```
## Schemas
```erd
id: library-api-schemas
entities:
- name: Book
columns:
- { name: id, type: "string", pk: true }
- { name: title, type: "string" }
- { name: author, type: "string" }
- { name: availableCopies, type: "int" }
- name: Problem
columns:
- { name: code, type: "string" }
- { name: message, type: "string" }
```