{"openapi":"3.0.0","info":{"version":"1.0","title":"3commerce","description":""},"servers":[{"description":"SwaggerHub API Auto Mocking","url":"https://virtserver.swaggerhub.com/h9275/3commerce/1.0"}],"tags":[{"name":"product","description":"Product methods","externalDocs":{"description":"Find out more","url":"http://swagger.io"}},{"name":"user","description":"User methods"}],"paths":{"/product":{"get":{"tags":["product"],"summary":"Get all products","responses":{"404":{"description":"Not Found"}}},"post":{"tags":["product"],"summary":"Update product","responses":{"405":{"description":"Invalid input"},"201":{"description":"Updated successfully"}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Product"}}},"description":"Created user object","required":true}}},"/product/{productId}":{"get":{"tags":["product"],"summary":"Get specific product by id","responses":{"200":{"description":"Successfully returned"},"404":{"description":"Product does not exist"}},"parameters":[{"name":"productId","in":"path","description":"id of product to return","required":true,"schema":{"type":"integer","format":"int64"}}]},"post":{"tags":["product"],"summary":"Update specific product by id","responses":{"200":{"description":"Successfully updated"},"404":{"description":"Product does not exist"}},"parameters":[{"name":"productId","in":"path","description":"id of product to return","required":true,"schema":{"type":"integer","format":"int64"}}]},"delete":{"tags":["product"],"summary":"Delete specific product by id","responses":{"200":{"description":"Successfully deleted"},"404":{"description":"Product does not exist"}},"parameters":[{"name":"productId","in":"path","description":"id of product to return","required":true,"schema":{"type":"integer","format":"int64"}}]}},"/user":{"get":{"tags":["user"],"summary":"Get all users","responses":{"404":{"description":"Not Found"}}},"post":{"tags":["user"],"summary":"Create user","description":"This can only be done by the logged in user.","operationId":"createUser","responses":{"default":{"description":"successful operation"}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/User"}}},"description":"Created user object","required":true}}},"/user/login":{"get":{"tags":["user"],"summary":"Logs user into the system","operationId":"loginUser","parameters":[{"name":"email","in":"query","description":"The email for login","required":true,"schema":{"type":"string"}},{"name":"password","in":"query","description":"The password for login in clear text","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"successful operation","headers":{"X-Rate-Limit":{"description":"calls per hour allowed by the user","schema":{"type":"integer","format":"int32"}},"X-Expires-After":{"description":"date in UTC when token expires","schema":{"type":"string","format":"date-time"}}},"content":{"application/json":{"schema":{"type":"string"}},"application/xml":{"schema":{"type":"string"}}}},"400":{"description":"Invalid email/password supplied"}}}},"/user/logout":{"get":{"tags":["user"],"summary":"Logs out current logged user","operationId":"logoutUser","responses":{"default":{"description":"successful operation"}}}},"/user/{username}":{"get":{"tags":["user"],"summary":"Get user by user name","operationId":"getUserByName","parameters":[{"name":"username","in":"path","description":"The name that needs to be fetched. Use user1 for testing.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"successful operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/User"}},"application/xml":{"schema":{"$ref":"#/components/schemas/User"}}}},"400":{"description":"Invalid username supplied"},"404":{"description":"User not found"}}},"put":{"tags":["user"],"summary":"Updated user","description":"This can only be done by the logged in user.","operationId":"updateUser","parameters":[{"name":"username","in":"path","description":"name that need to be updated","required":true,"schema":{"type":"string"}}],"responses":{"400":{"description":"Invalid user supplied"},"404":{"description":"User not found"}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/User"}}},"description":"Updated user object","required":true}},"delete":{"tags":["user"],"summary":"Delete user","description":"This can only be done by the logged in user.","operationId":"deleteUser","parameters":[{"name":"username","in":"path","description":"The name that needs to be deleted","required":true,"schema":{"type":"string"}}],"responses":{"400":{"description":"Invalid username supplied"},"404":{"description":"User not found"}}}}},"components":{"schemas":{"Order":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"category":{"$ref":"#/components/schemas/Category"},"productId":{"type":"integer","format":"int64"},"quantity":{"type":"integer","format":"int32"},"shipDate":{"type":"string","format":"date-time"},"status":{"type":"string","description":"Order Status","enum":["ordered","approved","delivered"]},"complete":{"type":"boolean","default":false}},"xml":{"name":"Order"}},"Category":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"name":{"type":"string"}},"xml":{"name":"Category"}},"User":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"username":{"type":"string"},"firstName":{"type":"string"},"lastName":{"type":"string"},"email":{"type":"string"},"password":{"type":"string"},"phone":{"type":"string"},"userStatus":{"type":"integer","format":"int32","description":"User Status"}},"xml":{"name":"User"}},"Product":{"type":"object","required":["name","photoUrls"],"properties":{"id":{"type":"integer","format":"int64"},"category":{"$ref":"#/components/schemas/Category"},"name":{"type":"string","example":"Blue pen"},"photoUrls":{"type":"array","xml":{"name":"photoUrl","wrapped":true},"items":{"type":"string"}},"status":{"type":"string","description":"product status in the store","enum":["available","pending","sold"]}},"xml":{"name":"Product"}}}}}