(1) This is the first time I sit down and write an API doc before writing the code. Thus do let me know if there is any flaw inside. Then I will start working on the actual code.
(2) It looks like swagger only supports python-flask for python when creating stub for server. Which framework do you prefer when you are using swagger?
What other HTTP return codes will be used? E.g. if you delete a product that doesn't exist, a 404 should be returned
Consider not exposing the product ID because it can leak business information e.g. Imagine if Amazon leaked order IDs (might indicate number of orders)
Delete product seems to accept a product ID in a different way to getting a product (I would be consistent)
You can probably drop the "product" prefix e.g. "productName" because you're already calling a product API call so this could just be "name"
I have no experience of Swagger and Python (only Swagger and PHP). Flask might be fun though.
@cjwfuller
Hi Chris,
I am creating this "issue" to track our conversation.
I have created the API spec here. It should be viewable without signing in into swagger. https://app.swaggerhub.com/apis/luyaosuperman/onlineshop/1.0.1
(1) This is the first time I sit down and write an API doc before writing the code. Thus do let me know if there is any flaw inside. Then I will start working on the actual code.
(2) It looks like swagger only supports python-flask for python when creating stub for server. Which framework do you prefer when you are using swagger?
Thank you!