Going to disagree with this as it's a leaky abstraction, exposing the unnecessary detail of having a database to the calling client.
Whether or not a database is queried to check if the book in fact exists or whether all books are simply static pages (though that's often not feasible) should not actually matter to the client. Unless the API is able to reply the other path of GET /boocs/8c2ba535-5523-47a5-8a72-281c316d5fc4 with a similar response such as
{
"data": {
"booc": null
}
}
then I don't think there's actually full consistency and a clear abstraction being made
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Going to disagree with this as it's a leaky abstraction, exposing the unnecessary detail of having a database to the calling client.
Whether or not a database is queried to check if the book in fact exists or whether all books are simply static pages (though that's often not feasible) should not actually matter to the client. Unless the API is able to reply the other path of
GET /boocs/8c2ba535-5523-47a5-8a72-281c316d5fc4with a similar response such asthen I don't think there's actually full consistency and a clear abstraction being made