Petstore API as REST API?
Wouldn't it be a good idea to design the API as a REST API? I'd like to show this sample in REST trainings, but unfortunately, it does not fit the guidelines.
Main points are
- URLs:
petsinstead ofpet,usersinstead ofuserfindByStatusandfindByTagsas parameters ofGET /pets- image upload with
PUT /pets/{petId}/image - Login/Logout (if done via the API) by using
POST
(Wouldn't have any problem to provide a merge request, but maybe it is a conscious decision to NOT fit REST guidelines?)
How about adding a comment to the readme that this is an example of a real world api and not an example of good api design.
There are for example conflicts and edge cases like:
- username login or logout
- update pet with POST and update user with PUT
- two pet updates routes that do the same.
Wow, in my real world, there are always good API designs! 😇😂
The pet store is the default sample in the Swagger Editor. And this is used esp. for (good) API design. So beginners might copy and customize fragments from this sample into their own API. Not a good role model... 😵😉