{"openapi":"3.0.3","info":{"title":"aNut API","description":"API of sales accounting tool","contact":{"name":"atronah","url":"http://atronah.com","email":"atronah.ds@gmail.com"},"version":"0.1.0"},"servers":[{"url":"/api/{ver}","description":"main server","variables":{"ver":{"default":"v0"}}}],"paths":{"/components":{"get":{"description":"Returns all components from the system that the user has access to\n","responses":{"200":{"description":"A list of components","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Component"}}}}},"406":{"description":"Invalid media type was specified in the `Accept` header (should be `application/json`)\n"}}},"post":{"description":"Creates new component","responses":{"201":{"description":"Data of created component","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Component"}}}}}}},"/components/{component_id}":{"get":{"description":"Returns component with specified ID\n","responses":{"200":{"description":"A component with specified ID","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Component"}}}},"default":{"$ref":"#/components/responses/GeneralError"}}},"put":{"description":"Updates component which has specified ID","responses":{"204":{"description":"Updated successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Component"}}}}}},"delete":{"description":"Destroy the component with specified ID","responses":{"204":{"description":"Removed successfully."},"404":{"$ref":"#/components/responses/NotFound"}}},"parameters":[{"name":"component_id","in":"path","required":true,"schema":{"type":"integer","format":"int64"}}]}},"components":{"schemas":{"GeneralErrorInfo":{"type":"object","properties":{"code":{"type":"integer","format":"int32"},"message":{"type":"string"}}},"Component":{"type":"object","required":["id","name"],"properties":{"id":{"type":"integer","format":"int64"},"code":{"type":"string"},"name":{"type":"string"}}}},"responses":{"NotFound":{"description":"Entity not found"},"GeneralError":{"description":"Request processing error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GeneralErrorInfo"}}}}}}}