Skip to content
chiltepin

Example brief: “Generate response flows and a shared-schema overview from the supplied OpenAPI contract.”

Library catalogue API OpenAPI import

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.

DOCUMENTAPI · v1.0.0

Library catalogue API

Illustrative API contract for the Chiltepin import example. No service is deployed at the example URL.

Overview

Illustrative API contract for the Chiltepin import example. No service is deployed at the example URL.

Endpoints

SECTION 01 · Comparison
MethodPathSummary
GET/booksSearch the catalogue
GET/books/{bookId}Read a book and its availability
POST/holdsRequest a hold at Central Library

GET /books

SECTION 02 · Sequence

Search the catalogue

SEQUENCE·GET/books
Sequence diagram: /books, 2 messages between 2 actorsClientAPI1GET /books2200 Matching books
Legendcallresponsethe answer the caller getsactive

GET /books/{bookId}

SECTION 03 · Sequence

Read a book and its availability

SEQUENCE·GET/books/{bookId}
Sequence diagram: /books/{bookId}, 3 messages between 2 actorsClientAPI1GET /books/{bookId}2200 The requested book3404 No book has this identifier
Legendcallresponseerrorthe answer the caller getsactive

POST /holds

SECTION 04 · Sequence

Request a hold at Central Library

SEQUENCE·POST/holds

This fixture only models the request contract. Authentication and circulation rules belong in the real service specification.

Sequence diagram: /holds, 3 messages between 2 actorsClientAPI1POST /holds2201 Hold recorded3409 No copy can currently be held
Legendcallresponseerrorthe answer the caller getsactive

Schemas

SECTION 05 · Entity model
ER
Entity relationship diagram: 2 entitiesENTITYBook#idstringtitlestringauthorstringavailableCopiesintENTITYProblemcodestringmessagestring
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" }
```