diff --git a/postman/collections/Book API/.resources/definition.yaml b/postman/collections/Book API/.resources/definition.yaml new file mode 100644 index 0000000..bd706d3 --- /dev/null +++ b/postman/collections/Book API/.resources/definition.yaml @@ -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: '' diff --git a/postman/collections/Book API/API Root.request.yaml b/postman/collections/Book API/API Root.request.yaml new file mode 100644 index 0000000..7a067cf --- /dev/null +++ b/postman/collections/Book API/API Root.request.yaml @@ -0,0 +1,6 @@ +$kind: http-request +name: API Root +method: GET +url: '{{baseUrl}}/' +description: 'Get API info and available routes' +order: 2000 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..8acd608 --- /dev/null +++ b/postman/collections/Book API/Books/.resources/definition.yaml @@ -0,0 +1,3 @@ +$kind: collection +name: Books +description: 'Book CRUD endpoints' 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..cf2fbdf --- /dev/null +++ b/postman/collections/Book API/Books/Create Book.request.yaml @@ -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 + } 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..2b89577 --- /dev/null +++ b/postman/collections/Book API/Books/Delete Book.request.yaml @@ -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 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..ebe8c22 --- /dev/null +++ b/postman/collections/Book API/Books/Get Book.request.yaml @@ -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 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..02432f8 --- /dev/null +++ b/postman/collections/Book API/Books/List Books.request.yaml @@ -0,0 +1,6 @@ +$kind: http-request +name: List Books +method: GET +url: '{{baseUrl}}/api/v1/books' +description: 'Retrieve all 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..289ca10 --- /dev/null +++ b/postman/collections/Book API/Books/Update Book.request.yaml @@ -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 + } diff --git a/postman/collections/Book API/Health Check.request.yaml b/postman/collections/Book API/Health Check.request.yaml new file mode 100644 index 0000000..80edf2e --- /dev/null +++ b/postman/collections/Book API/Health Check.request.yaml @@ -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