Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions postman/collections/Book API/.resources/definition.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
$kind: collection
name: Book API
description: 'CRUD API for managing books. Base URL: http://localhost:3000'
variables:
- key: baseUrl
value: 'http://localhost:3000'
- key: bookId
value: ''
6 changes: 6 additions & 0 deletions postman/collections/Book API/API Root.request.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
$kind: http-request
name: API Root
method: GET
url: '{{baseUrl}}/'
description: 'Get API info and available routes'
order: 2000
3 changes: 3 additions & 0 deletions postman/collections/Book API/Books/.resources/definition.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
$kind: collection
name: Books
description: 'Book CRUD endpoints'
14 changes: 14 additions & 0 deletions postman/collections/Book API/Books/Create Book.request.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
$kind: http-request
name: Create Book
method: POST
url: '{{baseUrl}}/api/v1/books'
description: 'Create a new book. Required fields: title (string), author (string). Optional: year (integer).'
order: 3000
body:
type: json
content: |-
{
"title": "The Great Gatsby",
"author": "F. Scott Fitzgerald",
"year": 1925
}
6 changes: 6 additions & 0 deletions postman/collections/Book API/Books/Delete Book.request.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
$kind: http-request
name: Delete Book
method: DELETE
url: '{{baseUrl}}/api/v1/books/{{bookId}}'
description: 'Delete a book by ID'
order: 5000
13 changes: 13 additions & 0 deletions postman/collections/Book API/Books/Get Book.request.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
$kind: http-request
name: Get Book
method: GET
url: "{{baseUrl}}/api/v1/books/{{bookId}}"
description: Retrieve a single book by ID
scripts:
- type: afterResponse
code: |-
pm.test("Status code is 200", function () {
pm.response.to.have.status(200);
});
language: text/javascript
order: 2000
6 changes: 6 additions & 0 deletions postman/collections/Book API/Books/List Books.request.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
$kind: http-request
name: List Books
method: GET
url: '{{baseUrl}}/api/v1/books'
description: 'Retrieve all books'
order: 1000
14 changes: 14 additions & 0 deletions postman/collections/Book API/Books/Update Book.request.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
$kind: http-request
name: Update Book
method: PUT
url: '{{baseUrl}}/api/v1/books/{{bookId}}'
description: 'Update an existing book by ID. Fields: title, author, year (all optional in update).'
order: 4000
body:
type: json
content: |-
{
"title": "The Great Gatsby (Updated)",
"author": "F. Scott Fitzgerald",
"year": 1925
}
6 changes: 6 additions & 0 deletions postman/collections/Book API/Health Check.request.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
$kind: http-request
name: Health Check
method: GET
url: '{{baseUrl}}/health'
description: 'Check if the API server is running'
order: 1000