From 8d69eeb37045a45314e4679f28b564778be89be1 Mon Sep 17 00:00:00 2001 From: Gbadebo Bello Date: Wed, 1 Apr 2026 19:14:34 +0200 Subject: [PATCH] test --- .postman/resources.yaml | 9 +++ README.md | 2 +- .../.collection.yaml | 73 +++++++++++++++++++ .../.resources/definition.yaml | 4 + .../Books/.folder.yaml | 4 + .../Books/Create Book.request.yaml | 18 +++++ .../Books/Delete Book.request.yaml | 9 +++ .../Books/Get Book.request.yaml | 9 +++ .../Books/List Books.request.yaml | 6 ++ .../Books/Update Book.request.yaml | 19 +++++ .../General/.folder.yaml | 4 + .../General/Health Check.request.yaml | 6 ++ .../General/Root.request.yaml | 6 ++ .../Book API/.resources/definition.yaml | 9 +++ .../Book API/Books/.resources/definition.yaml | 3 + .../Book API/Books/Create Book.request.yaml | 18 +++++ .../Book API/Books/Delete Book.request.yaml | 10 +++ .../Book API/Books/Get Book.request.yaml | 10 +++ .../Book API/Books/List Books.request.yaml | 6 ++ .../Book API/Books/Update Book.request.yaml | 22 ++++++ .../General/.resources/definition.yaml | 3 + .../General/Health Check.request.yaml | 6 ++ .../Book API/General/Root.request.yaml | 6 ++ .../New Collection/.resources/definition.yaml | 2 + .../New Collection/New Request.request.yaml | 7 ++ postman/globals/workspace.globals.yaml | 2 + 26 files changed, 272 insertions(+), 1 deletion(-) create mode 100644 .postman/resources.yaml create mode 100644 postman/collections/Book API - Full Reference/.collection.yaml create mode 100644 postman/collections/Book API - Full Reference/.resources/definition.yaml create mode 100644 postman/collections/Book API - Full Reference/Books/.folder.yaml create mode 100644 postman/collections/Book API - Full Reference/Books/Create Book.request.yaml create mode 100644 postman/collections/Book API - Full Reference/Books/Delete Book.request.yaml create mode 100644 postman/collections/Book API - Full Reference/Books/Get Book.request.yaml create mode 100644 postman/collections/Book API - Full Reference/Books/List Books.request.yaml create mode 100644 postman/collections/Book API - Full Reference/Books/Update Book.request.yaml create mode 100644 postman/collections/Book API - Full Reference/General/.folder.yaml create mode 100644 postman/collections/Book API - Full Reference/General/Health Check.request.yaml create mode 100644 postman/collections/Book API - Full Reference/General/Root.request.yaml create mode 100644 postman/collections/Book API/.resources/definition.yaml create mode 100644 postman/collections/Book API/Books/.resources/definition.yaml create mode 100644 postman/collections/Book API/Books/Create Book.request.yaml create mode 100644 postman/collections/Book API/Books/Delete Book.request.yaml create mode 100644 postman/collections/Book API/Books/Get Book.request.yaml create mode 100644 postman/collections/Book API/Books/List Books.request.yaml create mode 100644 postman/collections/Book API/Books/Update Book.request.yaml create mode 100644 postman/collections/Book API/General/.resources/definition.yaml create mode 100644 postman/collections/Book API/General/Health Check.request.yaml create mode 100644 postman/collections/Book API/General/Root.request.yaml create mode 100644 postman/collections/New Collection/.resources/definition.yaml create mode 100644 postman/collections/New Collection/New Request.request.yaml create mode 100644 postman/globals/workspace.globals.yaml diff --git a/.postman/resources.yaml b/.postman/resources.yaml new file mode 100644 index 0000000..8cbd47f --- /dev/null +++ b/.postman/resources.yaml @@ -0,0 +1,9 @@ +# Use this workspace to collaborate +workspace: + id: "" + +# All resources in the `postman/` folder are automatically registered in Local View. +# Point to additional files outside the `postman/` folder to register them individually. Example: +#localResources: +# collections: +# - ../tests/E2E Test Collection/ diff --git a/README.md b/README.md index e62bf78..0528edc 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,7 @@ Base URL: **http://localhost:3000** No authentication required. -## Examples +## Examples Of X **List books** ```bash diff --git a/postman/collections/Book API - Full Reference/.collection.yaml b/postman/collections/Book API - Full Reference/.collection.yaml new file mode 100644 index 0000000..0e116a1 --- /dev/null +++ b/postman/collections/Book API - Full Reference/.collection.yaml @@ -0,0 +1,73 @@ +$kind: collection +description: >- + # 📚 Book API - Full Reference + + + This collection is a complete API reference for the **Book API**, a RESTful + service built with Express.js for managing a book catalog. It covers every + available endpoint, organized into logical folders for easy navigation. + + + ## Base URL + + + `http://localhost:3000` + + + > The base URL is stored in the `{{baseUrl}}` collection variable and is + referenced across all requests. + + + ## 📂 Folders + + + ### General + + Utility endpoints for checking API status and retrieving service information. + + + | Method | Endpoint | Description | + + |--------|----------|-------------| + + | `GET` | `/` | Returns API info and documentation link | + + | `GET` | `/health` | Returns the health status of the API with a timestamp | + + + ### Books + + Full CRUD operations for managing books in the catalog. + + + | Method | Endpoint | Description | + + |--------|----------|-------------| + + | `GET` | `/api/v1/books` | List all books | + + | `GET` | `/api/v1/books/:id` | Get a single book by ID | + + | `POST` | `/api/v1/books` | Create a new book | + + | `PUT` | `/api/v1/books/:id` | Update an existing book | + + | `DELETE` | `/api/v1/books/:id` | Delete a book by ID | + + + ## 🚀 Getting Started + + + 1. **Set the base URL** — The `{{baseUrl}}` variable defaults to + `http://localhost:3000`. Update it in the collection variables if your server + runs on a different host or port. + + 2. **Start with General** — Use the **Root** and **Health Check** requests to + verify the API is running. + + 3. **Manage Books** — Use the **Books** folder to create, read, update, and + delete book records. A book requires a `title` and `author`; `year` and + `publisher` are optional. +variables: + - key: baseUrl + value: 'http://localhost:3000' \ No newline at end of file diff --git a/postman/collections/Book API - Full Reference/.resources/definition.yaml b/postman/collections/Book API - Full Reference/.resources/definition.yaml new file mode 100644 index 0000000..65a9296 --- /dev/null +++ b/postman/collections/Book API - Full Reference/.resources/definition.yaml @@ -0,0 +1,4 @@ +$kind: collection +name: Book API - Full Reference +variables: + baseUrl: "" diff --git a/postman/collections/Book API - Full Reference/Books/.folder.yaml b/postman/collections/Book API - Full Reference/Books/.folder.yaml new file mode 100644 index 0000000..ff4abb6 --- /dev/null +++ b/postman/collections/Book API - Full Reference/Books/.folder.yaml @@ -0,0 +1,4 @@ +$kind: collection +name: Books +description: CRUD operations for managing books +order: 2000 diff --git a/postman/collections/Book API - Full Reference/Books/Create Book.request.yaml b/postman/collections/Book API - Full Reference/Books/Create Book.request.yaml new file mode 100644 index 0000000..e795aa5 --- /dev/null +++ b/postman/collections/Book API - Full Reference/Books/Create Book.request.yaml @@ -0,0 +1,18 @@ +$kind: http-request +name: Create Book +description: 'Creates a new book. Requires `title` (string, required) and `author` (string, required). Optional fields: `year` (non-negative integer) and `publisher` (string).' +method: POST +url: '{{baseUrl}}/api/v1/books' +order: 3000 +headers: + - key: Content-Type + value: application/json +body: + type: json + content: |- + { + "title": "Dune", + "author": "Frank Herbert", + "year": 1965, + "publisher": "Chilton Books" + } diff --git a/postman/collections/Book API - Full Reference/Books/Delete Book.request.yaml b/postman/collections/Book API - Full Reference/Books/Delete Book.request.yaml new file mode 100644 index 0000000..dfc6fb6 --- /dev/null +++ b/postman/collections/Book API - Full Reference/Books/Delete Book.request.yaml @@ -0,0 +1,9 @@ +$kind: http-request +name: Delete Book +description: 'Deletes a book by ID. Returns 404 if the book is not found.' +method: DELETE +url: '{{baseUrl}}/api/v1/books/:id' +order: 5000 +pathVariables: + - key: id + value: '1' diff --git a/postman/collections/Book API - Full Reference/Books/Get Book.request.yaml b/postman/collections/Book API - Full Reference/Books/Get Book.request.yaml new file mode 100644 index 0000000..d3136d6 --- /dev/null +++ b/postman/collections/Book API - Full Reference/Books/Get Book.request.yaml @@ -0,0 +1,9 @@ +$kind: http-request +name: Get Book +description: 'Retrieves a single book by its ID. Returns 404 if the book is not found.' +method: GET +url: '{{baseUrl}}/api/v1/books/:id' +order: 2000 +pathVariables: + - key: id + value: '1' diff --git a/postman/collections/Book API - Full Reference/Books/List Books.request.yaml b/postman/collections/Book API - Full Reference/Books/List Books.request.yaml new file mode 100644 index 0000000..6a4a0b2 --- /dev/null +++ b/postman/collections/Book API - Full Reference/Books/List Books.request.yaml @@ -0,0 +1,6 @@ +$kind: http-request +name: List Books +description: Retrieves all books in the database. Returns an array of book objects. +method: GET +url: '{{baseUrl}}/api/v1/books' +order: 1000 diff --git a/postman/collections/Book API - Full Reference/Books/Update Book.request.yaml b/postman/collections/Book API - Full Reference/Books/Update Book.request.yaml new file mode 100644 index 0000000..0acc8b7 --- /dev/null +++ b/postman/collections/Book API - Full Reference/Books/Update Book.request.yaml @@ -0,0 +1,19 @@ +$kind: http-request +name: Update Book +description: 'Updates an existing book by ID. All fields are optional in the update payload. Returns 404 if the book is not found, 400 if validation fails.' +method: PUT +url: '{{baseUrl}}/api/v1/books/:id' +order: 4000 +pathVariables: + - key: id + value: '1' +headers: + - key: Content-Type + value: application/json +body: + type: json + content: |- + { + "title": "The Great Gatsby (Revised)", + "year": 1925 + } diff --git a/postman/collections/Book API - Full Reference/General/.folder.yaml b/postman/collections/Book API - Full Reference/General/.folder.yaml new file mode 100644 index 0000000..42500d4 --- /dev/null +++ b/postman/collections/Book API - Full Reference/General/.folder.yaml @@ -0,0 +1,4 @@ +$kind: collection +name: General +description: General utility and info endpoints +order: 1000 diff --git a/postman/collections/Book API - Full Reference/General/Health Check.request.yaml b/postman/collections/Book API - Full Reference/General/Health Check.request.yaml new file mode 100644 index 0000000..53e1d2d --- /dev/null +++ b/postman/collections/Book API - Full Reference/General/Health Check.request.yaml @@ -0,0 +1,6 @@ +$kind: http-request +name: Health Check +description: Returns the health status of the API with a timestamp. +method: GET +url: '{{baseUrl}}/health' +order: 2000 diff --git a/postman/collections/Book API - Full Reference/General/Root.request.yaml b/postman/collections/Book API - Full Reference/General/Root.request.yaml new file mode 100644 index 0000000..64b13b9 --- /dev/null +++ b/postman/collections/Book API - Full Reference/General/Root.request.yaml @@ -0,0 +1,6 @@ +$kind: http-request +name: Root +description: Returns API info and documentation link. +method: GET +url: '{{baseUrl}}/' +order: 1000 diff --git a/postman/collections/Book API/.resources/definition.yaml b/postman/collections/Book API/.resources/definition.yaml new file mode 100644 index 0000000..c724b78 --- /dev/null +++ b/postman/collections/Book API/.resources/definition.yaml @@ -0,0 +1,9 @@ +$kind: collection +name: Book API +description: A REST API for managing books. This collection provides endpoints for creating, reading, updating, and deleting books in the system. +variables: + - key: baseUrl + value: 'http://localhost:3000' + - key: bookId + value: '' + description: Book ID to be filled during testing diff --git a/postman/collections/Book API/Books/.resources/definition.yaml b/postman/collections/Book API/Books/.resources/definition.yaml new file mode 100644 index 0000000..dae2d98 --- /dev/null +++ b/postman/collections/Book API/Books/.resources/definition.yaml @@ -0,0 +1,3 @@ +$kind: collection +name: Books +description: Endpoints for managing books - create, read, update, and delete operations diff --git a/postman/collections/Book API/Books/Create Book.request.yaml b/postman/collections/Book API/Books/Create Book.request.yaml new file mode 100644 index 0000000..04964bd --- /dev/null +++ b/postman/collections/Book API/Books/Create Book.request.yaml @@ -0,0 +1,18 @@ +$kind: http-request +name: Create Book +description: Create a new book +method: POST +url: '{{baseUrl}}/api/v1/books' +order: 3000 +headers: + - key: Content-Type + value: application/json +body: + type: json + content: |- + { + "title": "The Great Gatsby", + "author": "F. Scott Fitzgerald", + "year": 1925, + "publisher": "Charles Scribner's Sons" + } diff --git a/postman/collections/Book API/Books/Delete Book.request.yaml b/postman/collections/Book API/Books/Delete Book.request.yaml new file mode 100644 index 0000000..805e8d9 --- /dev/null +++ b/postman/collections/Book API/Books/Delete Book.request.yaml @@ -0,0 +1,10 @@ +$kind: http-request +name: Delete Book +description: Delete a book by ID +method: DELETE +url: '{{baseUrl}}/api/v1/books/{{bookId}}' +order: 5000 +pathVariables: + - key: bookId + value: '{{bookId}}' + description: The unique identifier of the book to delete diff --git a/postman/collections/Book API/Books/Get Book.request.yaml b/postman/collections/Book API/Books/Get Book.request.yaml new file mode 100644 index 0000000..4693e91 --- /dev/null +++ b/postman/collections/Book API/Books/Get Book.request.yaml @@ -0,0 +1,10 @@ +$kind: http-request +name: Get Book +description: Get a specific book by ID +method: GET +url: '{{baseUrl}}/api/v1/books/{{bookId}}' +order: 2000 +pathVariables: + - key: bookId + value: '{{bookId}}' + description: The unique identifier of the book diff --git a/postman/collections/Book API/Books/List Books.request.yaml b/postman/collections/Book API/Books/List Books.request.yaml new file mode 100644 index 0000000..f7945f7 --- /dev/null +++ b/postman/collections/Book API/Books/List Books.request.yaml @@ -0,0 +1,6 @@ +$kind: http-request +name: List Books +description: Get all books +method: GET +url: '{{baseUrl}}/api/v1/books' +order: 1000 diff --git a/postman/collections/Book API/Books/Update Book.request.yaml b/postman/collections/Book API/Books/Update Book.request.yaml new file mode 100644 index 0000000..3e18668 --- /dev/null +++ b/postman/collections/Book API/Books/Update Book.request.yaml @@ -0,0 +1,22 @@ +$kind: http-request +name: Update Book +description: Update an existing book +method: PUT +url: '{{baseUrl}}/api/v1/books/{{bookId}}' +order: 4000 +headers: + - key: Content-Type + value: application/json +pathVariables: + - key: bookId + value: '{{bookId}}' + description: The unique identifier of the book to update +body: + type: json + content: |- + { + "title": "Updated Title", + "author": "Updated Author", + "year": 2024, + "publisher": "Updated Publisher" + } diff --git a/postman/collections/Book API/General/.resources/definition.yaml b/postman/collections/Book API/General/.resources/definition.yaml new file mode 100644 index 0000000..0ae6b98 --- /dev/null +++ b/postman/collections/Book API/General/.resources/definition.yaml @@ -0,0 +1,3 @@ +$kind: collection +name: General +description: General endpoints for API information and health checks diff --git a/postman/collections/Book API/General/Health Check.request.yaml b/postman/collections/Book API/General/Health Check.request.yaml new file mode 100644 index 0000000..9f6bed4 --- /dev/null +++ b/postman/collections/Book API/General/Health Check.request.yaml @@ -0,0 +1,6 @@ +$kind: http-request +name: Health Check +description: Health check endpoint returning status and timestamp +method: GET +url: '{{baseUrl}}/health' +order: 2000 diff --git a/postman/collections/Book API/General/Root.request.yaml b/postman/collections/Book API/General/Root.request.yaml new file mode 100644 index 0000000..c1bfeae --- /dev/null +++ b/postman/collections/Book API/General/Root.request.yaml @@ -0,0 +1,6 @@ +$kind: http-request +name: Root +description: Returns API info and documentation link +method: GET +url: '{{baseUrl}}/' +order: 1000 diff --git a/postman/collections/New Collection/.resources/definition.yaml b/postman/collections/New Collection/.resources/definition.yaml new file mode 100644 index 0000000..8697d90 --- /dev/null +++ b/postman/collections/New Collection/.resources/definition.yaml @@ -0,0 +1,2 @@ +$kind: collection +name: New Collection diff --git a/postman/collections/New Collection/New Request.request.yaml b/postman/collections/New Collection/New Request.request.yaml new file mode 100644 index 0000000..862ab41 --- /dev/null +++ b/postman/collections/New Collection/New Request.request.yaml @@ -0,0 +1,7 @@ +$kind: mcp-request +transport: stdio +command: "" +message: "" +settings: + requestTimeout: 0 +order: 1775040399311 diff --git a/postman/globals/workspace.globals.yaml b/postman/globals/workspace.globals.yaml new file mode 100644 index 0000000..e96c6d6 --- /dev/null +++ b/postman/globals/workspace.globals.yaml @@ -0,0 +1,2 @@ +name: Globals +values: []