{"swagger":"2.0","info":{"title":"The virtual wine cellar","description":"A basic example of a CRUD API implemented with goa","contact":{"name":"goa team","email":"admin@goa.design","url":"http://goa.design"},"license":{"name":"MIT","url":"https://github.com/goadesign/goa/blob/master/LICENSE"},"version":""},"host":"localhost:8081","schemes":["http"],"consumes":["application/json","application/xml","application/gob","application/x-gob"],"produces":["application/json","application/xml","application/gob","application/x-gob"],"paths":{"/cellar/accounts":{"get":{"tags":["account"],"summary":"list account","description":"Retrieve all accounts.","operationId":"account#list","responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/AccountCollection"}},"404":{"description":"Not Found"}},"schemes":["http"]},"post":{"tags":["account"],"summary":"create account","description":"Create new account","operationId":"account#create","parameters":[{"name":"payload","in":"body","required":true,"schema":{"$ref":"#/definitions/CreateAccountPayload"}}],"responses":{"201":{"description":"Resource created","headers":{"Location":{"description":"href to created resource","type":"string","pattern":"/accounts/[0-9]+"}}}},"schemes":["http"]}},"/cellar/accounts/{accountID}":{"get":{"tags":["account"],"summary":"show account","description":"Retrieve account with given id. IDs 1 and 2 pre-exist in the system.","operationId":"account#show","parameters":[{"name":"accountID","in":"path","description":"Account ID","required":true,"type":"integer"}],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/Account"}},"404":{"description":"Not Found"}},"schemes":["http"]},"put":{"tags":["account"],"summary":"update account","description":"Change account name","operationId":"account#update","parameters":[{"name":"accountID","in":"path","description":"Account ID","required":true,"type":"integer"},{"name":"payload","in":"body","required":true,"schema":{"$ref":"#/definitions/UpdateAccountPayload"}}],"responses":{"204":{"description":"No Content"},"404":{"description":"Not Found"}},"schemes":["http"]},"delete":{"tags":["account"],"summary":"delete account","operationId":"account#delete","parameters":[{"name":"accountID","in":"path","description":"Account ID","required":true,"type":"integer"}],"responses":{"204":{"description":"No Content"},"404":{"description":"Not Found"}},"schemes":["http"]}},"/cellar/accounts/{accountID}/bottles":{"get":{"tags":["bottle"],"summary":"list bottle","description":"List all bottles in account optionally filtering by year","operationId":"bottle#list","parameters":[{"name":"accountID","in":"path","description":"Account ID","required":true,"type":"integer"},{"name":"years","in":"query","description":"Filter by years","required":false,"type":"array","items":{"type":"integer"}}],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/BottleCollection"}},"404":{"description":"Not Found"}},"schemes":["http"]},"post":{"tags":["bottle"],"summary":"create bottle","description":"Record new bottle","operationId":"bottle#create","parameters":[{"name":"accountID","in":"path","description":"Account ID","required":true,"type":"integer"},{"name":"payload","in":"body","required":true,"schema":{"$ref":"#/definitions/CreateBottlePayload"}}],"responses":{"201":{"description":"Resource created","headers":{"Location":{"description":"href to created resource","type":"string","pattern":"^/accounts/[0-9]+/bottles/[0-9]+$"}}},"404":{"description":"Not Found"}},"schemes":["http"]}},"/cellar/accounts/{accountID}/bottles/{bottleID}":{"get":{"tags":["bottle"],"summary":"show bottle","description":"Retrieve bottle with given id","operationId":"bottle#show","parameters":[{"name":"accountID","in":"path","description":"Account ID","required":true,"type":"integer"},{"name":"bottleID","in":"path","required":true,"type":"integer"}],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/Bottle"}},"404":{"description":"Not Found"}},"schemes":["http"]},"delete":{"tags":["bottle"],"summary":"delete bottle","operationId":"bottle#delete","parameters":[{"name":"accountID","in":"path","description":"Account ID","required":true,"type":"integer"},{"name":"bottleID","in":"path","required":true,"type":"integer"}],"responses":{"204":{"description":"No Content"},"404":{"description":"Not Found"}},"schemes":["http"]},"patch":{"tags":["bottle"],"summary":"update bottle","operationId":"bottle#update","parameters":[{"name":"accountID","in":"path","description":"Account ID","required":true,"type":"integer"},{"name":"bottleID","in":"path","required":true,"type":"integer"},{"name":"payload","in":"body","required":true,"schema":{"$ref":"#/definitions/UpdateBottlePayload"}}],"responses":{"204":{"description":"No Content"},"404":{"description":"Not Found"}},"schemes":["http"]}},"/cellar/accounts/{accountID}/bottles/{bottleID}/actions/rate":{"put":{"tags":["bottle"],"summary":"rate bottle","operationId":"bottle#rate","parameters":[{"name":"accountID","in":"path","description":"Account ID","required":true,"type":"integer"},{"name":"bottleID","in":"path","required":true,"type":"integer"},{"name":"payload","in":"body","required":true,"schema":{"$ref":"#/definitions/RateBottlePayload"}}],"responses":{"204":{"description":"No Content"},"404":{"description":"Not Found"}},"schemes":["http"]}},"/cellar/accounts/{accountID}/bottles/{bottleID}/watch":{"get":{"tags":["bottle"],"summary":"watch bottle","description":"Retrieve bottle with given id","operationId":"bottle#watch","parameters":[{"name":"accountID","in":"path","description":"Account ID","required":true,"type":"integer"},{"name":"bottleID","in":"path","required":true,"type":"integer"}],"responses":{"101":{"description":"Switching Protocols"}},"schemes":["ws"]}},"/js/{filepath}":{"get":{"summary":"Download public/js/","operationId":"public#/js/*filepath","parameters":[{"name":"filepath","in":"path","description":"Relative file path","required":true,"type":"string"}],"responses":{"200":{"description":"File downloaded","schema":{"type":"file"}},"404":{"description":"File not found","schema":{"$ref":"#/definitions/error"}}},"schemes":["http"]}},"/schema.json":{"get":{"summary":"Download public/schema/schema.json","operationId":"public#/schema.json","responses":{"200":{"description":"File downloaded","schema":{"type":"file"}}},"schemes":["http"]}},"/swagger.json":{"get":{"summary":"Download public/swagger/swagger.json","operationId":"public#/swagger.json","responses":{"200":{"description":"File downloaded","schema":{"type":"file"}}},"schemes":["http"]}},"/ui":{"get":{"summary":"Download public/html/index.html","operationId":"public#/ui","responses":{"200":{"description":"File downloaded","schema":{"type":"file"}}},"schemes":["http"]}}},"definitions":{"Account":{"title":"Mediatype identifier: application/vnd.account+json","type":"object","properties":{"created_at":{"type":"string","description":"Date of creation","example":"2015-09-23T11:51:57-07:00","format":"date-time"},"created_by":{"type":"string","description":"Email of account owner","example":"loyce.doyle@pollich.com","format":"email"},"href":{"type":"string","description":"API href of account","example":"Et ut omnis praesentium non."},"id":{"type":"integer","description":"ID of account","example":6955004332577425173,"format":"int64"},"name":{"type":"string","description":"Name of account","example":"Explicabo laboriosam consequatur."}},"description":"A tenant account (default view)","example":{"created_at":"2015-09-23T11:51:57-07:00","created_by":"loyce.doyle@pollich.com","href":"Et ut omnis praesentium non.","id":6955004332577425173,"name":"Explicabo laboriosam consequatur."},"required":["id","href","name","created_at","created_by"]},"AccountCollection":{"title":"Mediatype identifier: application/vnd.account+json; type=collection","type":"array","items":{"$ref":"#/definitions/Account"},"description":"AccountCollection is the media type for an array of Account (default view)","example":[{"created_at":"2015-09-23T11:51:57-07:00","created_by":"loyce.doyle@pollich.com","href":"Et ut omnis praesentium non.","id":6955004332577425173,"name":"Explicabo laboriosam consequatur."},{"created_at":"2015-09-23T11:51:57-07:00","created_by":"loyce.doyle@pollich.com","href":"Et ut omnis praesentium non.","id":6955004332577425173,"name":"Explicabo laboriosam consequatur."}]},"AccountLink":{"title":"Mediatype identifier: application/vnd.account+json","type":"object","properties":{"href":{"type":"string","description":"API href of account","example":"Et ut omnis praesentium non."},"id":{"type":"integer","description":"ID of account","example":6955004332577425173,"format":"int64"}},"description":"A tenant account (link view)","example":{"created_at":"2015-09-23T11:51:57-07:00","created_by":"loyce.doyle@pollich.com","href":"Et ut omnis praesentium non.","id":6955004332577425173,"name":"Explicabo laboriosam consequatur."},"required":["id","href"]},"Bottle":{"title":"Mediatype identifier: application/vnd.bottle+json","type":"object","properties":{"account":{"$ref":"#/definitions/Account"},"href":{"type":"string","description":"API href of bottle","example":"Enim suscipit est explicabo eveniet dolore."},"id":{"type":"integer","description":"ID of bottle","example":7974807415321457835,"format":"int64"},"links":{"$ref":"#/definitions/BottleLinks"},"name":{"type":"string","example":"6h","minLength":2},"rating":{"type":"integer","description":"Rating of bottle between 1 and 5","example":3,"minimum":1,"maximum":5},"varietal":{"type":"string","example":"d2xq5","minLength":4},"vineyard":{"type":"string","example":"6r6y","minLength":2},"vintage":{"type":"integer","example":1982,"minimum":1900,"maximum":2020}},"description":"A bottle of wine (default view)","example":{"account":{"created_at":"2015-09-23T11:51:57-07:00","created_by":"loyce.doyle@pollich.com","href":"Et ut omnis praesentium non.","id":6955004332577425173,"name":"Explicabo laboriosam consequatur."},"color":"white","country":"sok","created_at":"1997-07-28T18:41:27-07:00","href":"Enim suscipit est explicabo eveniet dolore.","id":7974807415321457835,"name":"6h","rating":3,"region":"Veniam fugit.","review":"qzxmvof","sweetness":3,"updated_at":"1999-05-09T06:21:29-07:00","varietal":"d2xq5","vineyard":"6r6y","vintage":1982},"required":["id","href","name","vineyard","varietal","vintage"]},"BottleCollection":{"title":"Mediatype identifier: application/vnd.bottle+json; type=collection","type":"array","items":{"$ref":"#/definitions/Bottle"},"description":"BottleCollection is the media type for an array of Bottle (default view)","example":[{"account":{"created_at":"2015-09-23T11:51:57-07:00","created_by":"loyce.doyle@pollich.com","href":"Et ut omnis praesentium non.","id":6955004332577425173,"name":"Explicabo laboriosam consequatur."},"href":"Enim suscipit est explicabo eveniet dolore.","id":7974807415321457835,"links":{"account":{"href":"Et ut omnis praesentium non.","id":6955004332577425173}},"name":"6h","rating":3,"varietal":"d2xq5","vineyard":"6r6y","vintage":1982},{"account":{"created_at":"2015-09-23T11:51:57-07:00","created_by":"loyce.doyle@pollich.com","href":"Et ut omnis praesentium non.","id":6955004332577425173,"name":"Explicabo laboriosam consequatur."},"href":"Enim suscipit est explicabo eveniet dolore.","id":7974807415321457835,"links":{"account":{"href":"Et ut omnis praesentium non.","id":6955004332577425173}},"name":"6h","rating":3,"varietal":"d2xq5","vineyard":"6r6y","vintage":1982}]},"BottleLinks":{"title":"BottleLinks","type":"object","properties":{"account":{"$ref":"#/definitions/AccountLinkLink"}},"description":"BottleLinks contains links to related resources of Bottle."},"CreateAccountPayload":{"title":"CreateAccountPayload","type":"object","properties":{"name":{"type":"string","description":"Name of account"}},"required":["name"]},"CreateBottlePayload":{"title":"CreateBottlePayload","type":"object","properties":{"color":{"type":"string","enum":["red","white","rose","yellow","sparkling"]},"country":{"type":"string","minLength":2},"name":{"type":"string","minLength":2},"region":{"type":"string"},"review":{"type":"string","minLength":3,"maxLength":300},"sweetness":{"type":"integer","minimum":1,"maximum":5},"varietal":{"type":"string","minLength":4},"vineyard":{"type":"string","minLength":2},"vintage":{"type":"integer","minimum":1900,"maximum":2020}},"required":["name","vineyard","varietal","vintage","color"]},"RateBottlePayload":{"title":"RateBottlePayload","type":"object","properties":{"rating":{"type":"integer","description":"Rating of bottle between 1 and 5","minimum":1,"maximum":5}},"required":["rating"]},"UpdateAccountPayload":{"title":"UpdateAccountPayload","type":"object","properties":{"name":{"type":"string","description":"Name of account"}},"required":["name"]},"UpdateBottlePayload":{"title":"UpdateBottlePayload","type":"object","properties":{"color":{"type":"string","enum":["red","white","rose","yellow","sparkling"]},"country":{"type":"string","minLength":2},"name":{"type":"string","minLength":2},"region":{"type":"string"},"review":{"type":"string","minLength":3,"maxLength":300},"sweetness":{"type":"integer","minimum":1,"maximum":5},"varietal":{"type":"string","minLength":4},"vineyard":{"type":"string","minLength":2},"vintage":{"type":"integer","minimum":1900,"maximum":2020}}},"error":{"title":"Mediatype identifier: application/vnd.api.error+json","type":"object","properties":{"code":{"type":"string","description":"an application-specific error code, expressed as a string value.","example":"invalid_value"},"detail":{"type":"string","description":"a human-readable explanation specific to this occurrence of the problem.","example":"Value of ID must be an integer"},"id":{"type":"string","description":"a unique identifier for this particular occurrence of the problem.","example":"3F1FKVRR"},"meta":{"type":"object","description":"a meta object containing non-standard meta-information about the error.","example":{"timestamp":1458609066},"additionalProperties":true},"status":{"type":"string","description":"the HTTP status code applicable to this problem, expressed as a string value.","example":"400"}},"description":"Error response media type (default view)","example":{"code":"invalid_value","detail":"Value of ID must be an integer","id":"3F1FKVRR","meta":{"timestamp":1458609066},"status":"400"}}},"responses":{"NoContent":{"description":"No Content"},"NotFound":{"description":"Not Found"},"OK":{"description":"OK","schema":{"$ref":"#/definitions/Account"}},"SwitchingProtocols":{"description":"Switching Protocols"}},"externalDocs":{"description":"goa guide","url":"http://goa.design/getting-started.html"}}