oscarngncc / COMP4111_project

COMP4111 project
0 stars 0 forks source link

Searching books with non-numeric ids produces incorrect result #22

Open STommydx opened 4 years ago

STommydx commented 4 years ago

Describe the bug Searching books with non-numeric ids produces incorrect result. The result returned contains all books.

To Reproduce

  1. Login as usual
  2. Add a book
    {
            "Title": "# Book!",
            "Author": "Author",
            "Publisher": "Publisher",
            "Year": "2028"
    }
  3. Search book with an non-numeric id GET localhost:8080/BookManagementService/books?token={{token}}&id=jeng

Expected behavior 204 No Content

What actually happens 200 OK with the book returned

{
    "FoundBooks": 1,
    "Results": [
        {
            "Title": "# Book!",
            "Author": "Author",
            "Publisher": "Publisher",
            "Year": "2028"
        }
    ]
}