{"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":"cellar.goa.design","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":{"post":{"summary":"create","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"],"security":[{"admin_pass":[]}]}},"/cellar/accounts/{accountID}":{"get":{"summary":"show","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":{"summary":"update","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":{"summary":"delete","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":{"summary":"list","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":{"summary":"create","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]+$"}}}},"schemes":["http"]}},"/cellar/accounts/{accountID}/bottles/{bottleID}":{"get":{"summary":"show","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":{"summary":"delete","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":{"summary":"update","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":{"summary":"rate","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":{"summary":"watch","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","example":{"created_at":"2008-01-22T00:07:16-08:00","created_by":"Vero est mollitia eos voluptas.","href":"Enim suscipit est explicabo eveniet dolore.","id":7974807415321457835,"name":"Saepe eum cumque sint veniam."},"required":["id","href","name","created_at","created_by"]},"Bottle":{"title":"Mediatype identifier: application/vnd.bottle+json","type":"object","properties":{"account":{"$ref":"#/definitions/Account"},"color":{"type":"string","example":"yellow","enum":["red","white","rose","yellow","sparkling"]},"country":{"type":"string","example":"q5","minLength":2},"created_at":{"type":"string","description":"Date of creation","example":"2002-01-26T17:01:26-08:00","format":"date-time"},"href":{"type":"string","description":"API href of bottle","example":"Magni tempora."},"id":{"type":"integer","description":"ID of bottle","example":7555022654784799462,"format":"int64"},"name":{"type":"string","example":"7hb","minLength":2},"rating":{"type":"integer","description":"Rating of bottle between 1 and 5","example":4,"minimum":1,"maximum":5},"region":{"type":"string","example":"Consequuntur recusandae."},"review":{"type":"string","example":"bzvfxy6","minLength":3,"maxLength":300},"sweetness":{"type":"integer","example":3,"minimum":1,"maximum":5},"updated_at":{"type":"string","description":"Date of last update","example":"1994-04-05T12:08:05-07:00","format":"date-time"},"varietal":{"type":"string","example":"jue8","minLength":4},"vineyard":{"type":"string","example":"rba","minLength":2},"vintage":{"type":"integer","example":2010,"minimum":1900,"maximum":2020}},"description":"A bottle of wine","example":{"account":{"created_at":"1988-08-18T23:20:28-07:00","created_by":"Iure tenetur sapiente et ut.","href":"Voluptatem voluptatem voluptas veritatis.","id":9182514534248429122,"name":"Sunt ut accusamus soluta."},"color":"Nostrum dolore et maiores quidem iusto.","country":"Qui aut quaerat id unde sed.","created_at":"2001-07-20T06:36:36-07:00","href":"Ut nisi est.","id":4090774733257597705,"name":"Quis ipsa occaecati dolorum.","rating":4824841476149921842,"region":"Rem voluptatem.","review":"Recusandae quam qui labore animi.","sweetness":1037731629248779317,"updated_at":"1987-01-07T15:39:20-08:00","varietal":"Pariatur quam quo laudantium qui ducimus.","vineyard":"Eos a provident quia omnis iure atque.","vintage":8367774663587655380},"required":["id","href","name","vineyard","varietal","vintage","color","created_at"]},"BottleCollection":{"title":"Mediatype identifier: application/vnd.bottle+json; type=collection","type":"array","items":{"$ref":"#/definitions/Bottle"},"example":[{"account":{"created_at":"1997-11-14T12:42:49-08:00","created_by":"Optio corporis quam delectus.","href":"Exercitationem alias est dolores.","id":3347861173922627126,"name":"Ducimus expedita in quam eos distinctio."},"color":"Ut molestiae possimus.","country":"Aliquam itaque quam beatae veniam quaerat sint.","created_at":"2000-07-18T03:19:44-07:00","href":"Sit qui ut delectus.","id":7640329084661479331,"name":"Nulla architecto magni eos tempora sapiente.","rating":5453320523006636529,"region":"Beatae eveniet et tempora nobis enim.","review":"Dolorum libero qui.","sweetness":2577229455419271519,"updated_at":"1980-11-29T23:07:41-08:00","varietal":"Iste dolorem officiis aut magnam commodi.","vineyard":"Voluptatem deserunt cupiditate eveniet repellat qui.","vintage":2046456512869275029}]},"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"]},"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","example":{"code":"invalid_value","detail":"Value of ID must be an integer","id":"3F1FKVRR","meta":{"timestamp":1458609066},"status":"400"}},"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}}}},"responses":{"NoContent":{"description":"No Content"},"NotFound":{"description":"Not Found"},"OK":{"description":"OK","schema":{"$ref":"#/definitions/Account"}},"SwitchingProtocols":{"description":"Switching Protocols"}},"securityDefinitions":{"admin_pass":{"type":"basic","description":"Basic authentication method, for global admin authentication.\n\nHere are very secret credentials:\n* username: wine\n* password: lover\n"}},"externalDocs":{"description":"goa guide","url":"http://goa.design/getting-started.html"}}