{"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","basePath":"/cellar","schemes":["http"],"consumes":["application/json","application/xml","application/gob","application/x-gob"],"produces":["application/json","application/xml","application/gob","application/x-gob"],"paths":{"/accounts":{"post":{"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":[]}]}},"/accounts/{accountID}":{"get":{"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":{"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":{"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"]}},"/accounts/{accountID}/bottles":{"get":{"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":{"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"]}},"/accounts/{accountID}/bottles/{bottleID}":{"get":{"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":{"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":{"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"]}},"/accounts/{accountID}/bottles/{bottleID}/actions/rate":{"put":{"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"]}},"/accounts/{accountID}/bottles/{bottleID}/watch":{"get":{"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"]}}},"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"]},"Bottle":{"title":"Mediatype identifier: application/vnd.bottle+json","type":"object","properties":{"account":{"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":"Account that owns bottle","example":{"created_at":"1970-12-24T20:38:00-08:00","created_by":"Earum repellat eos.","href":"Corrupti corrupti qui.","id":6346709705387786626,"name":"Laboriosam accusamus."},"required":["id","href","name"]},"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"]},"BottleCollection":{"title":"Mediatype identifier: application/vnd.bottle+json; type=collection","type":"array","items":{"type":"object","properties":{"account":{"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":"Account that owns bottle","example":{"created_at":"1970-12-24T20:38:00-08:00","created_by":"Earum repellat eos.","href":"Corrupti corrupti qui.","id":6346709705387786626,"name":"Laboriosam accusamus."},"required":["id","href","name"]},"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}},"example":{"account":{"created_at":"2014-10-24T15:06:00-07:00","created_by":"Aut non necessitatibus ab repellendus quidem modi.","href":"Incidunt recusandae.","id":285486220072084801,"name":"Voluptatem ut qui."},"color":"Sunt sit dolor magnam dolores.","country":"Quibusdam aut quibusdam.","created_at":"1996-10-24T19:50:17-07:00","href":"Quis aut rem vel veritatis aut.","id":3459156443874954271,"name":"Aut aut.","rating":5128319310223807881,"region":"Aliquid facere.","review":"Placeat ea vel molestiae incidunt earum.","sweetness":1360993221073835903,"updated_at":"1982-09-15T22:09:33-07:00","varietal":"Iusto aut officia rerum.","vineyard":"Qui natus et aut soluta minus.","vintage":6290061784391317912},"required":["id","href","name","vineyard","varietal","vintage","color"]},"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"]},"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"}}