{"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":{"summary":"list","description":"Retrieve all accounts.","operationId":"account#list","responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/AccountCollection"}},"404":{"description":"Not Found"}},"schemes":["http"]},"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"]}},"/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]+$"}}},"404":{"description":"Not Found"}},"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"]},"AccountCollection":{"title":"Mediatype identifier: application/vnd.account+json; type=collection","type":"array","items":{"$ref":"#/definitions/Account"},"example":[{"created_at":"1978-02-18T21:20:57-08:00","created_by":"Reiciendis ea architecto magni tempora.","href":"Distinctio delectus vel earum doloribus.","id":6579681337256421773,"name":"Recusandae molestiae nemo omnis quae suscipit."},{"created_at":"1972-08-12T17:28:45-07:00","created_by":"Sapiente et sunt dolorem.","href":"Ea est.","id":322851273302643740,"name":"Sequi blanditiis dolore laudantium repellat perspiciatis iure."},{"created_at":"2006-10-10T05:51:30-07:00","created_by":"Et ut repellat voluptatem voluptatem voluptas veritatis.","href":"Dignissimos sunt ut accusamus soluta.","id":1325867454080699083,"name":"Dolore et."}]},"Bottle":{"title":"Mediatype identifier: application/vnd.bottle+json","type":"object","properties":{"account":{"$ref":"#/definitions/Account"},"color":{"type":"string","example":"red","enum":["red","white","rose","yellow","sparkling"]},"country":{"type":"string","example":"wjin","minLength":2},"created_at":{"type":"string","description":"Date of creation","example":"2011-12-29T17:17:22-08:00","format":"date-time"},"href":{"type":"string","description":"API href of bottle","example":"Rem voluptatem."},"id":{"type":"integer","description":"ID of bottle","example":5572033344058389316,"format":"int64"},"name":{"type":"string","example":"0v","minLength":2},"rating":{"type":"integer","description":"Rating of bottle between 1 and 5","example":4,"minimum":1,"maximum":5},"region":{"type":"string","example":"Enim nam nemo pariatur quam quo laudantium."},"review":{"type":"string","example":"gx4","minLength":3,"maxLength":300},"sweetness":{"type":"integer","example":2,"minimum":1,"maximum":5},"updated_at":{"type":"string","description":"Date of last update","example":"2011-07-06T02:59:22-07:00","format":"date-time"},"varietal":{"type":"string","example":"ulxw","minLength":4},"vineyard":{"type":"string","example":"w8","minLength":2},"vintage":{"type":"integer","example":1958,"minimum":1900,"maximum":2020}},"description":"A bottle of wine","example":{"account":{"created_at":"2012-05-30T13:43:59-07:00","created_by":"Repellendus quidem modi iste incidunt.","href":"Omnis eveniet voluptatem.","id":5392529602597722381,"name":"Et sunt sit dolor magnam dolores."},"color":"Quibusdam aut quibusdam.","country":"Ex quis aut rem.","created_at":"2002-11-08T19:24:24-08:00","href":"Aut animi nulla aut aut.","id":5128319310223807881,"name":"Aliquid facere.","rating":8590149035298657361,"region":"Ea vel.","review":"Incidunt earum dolorem suscipit ut iusto.","sweetness":6596242208426853207,"updated_at":"1995-11-13T20:26:35-08:00","varietal":"Harum qui natus et aut.","vineyard":"Minus rerum ut libero tempore optio.","vintage":8348819018070273167},"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":"1981-07-23T18:31:00-07:00","created_by":"Odit aperiam voluptatem aut.","href":"Vel molestiae culpa incidunt omnis nobis nobis.","id":2215488427025974081,"name":"Totam minus nihil iure."},"color":"Est fugiat.","country":"Occaecati quas doloremque et laborum fugit eos.","created_at":"2013-12-12T09:48:24-08:00","href":"Dolore iusto perspiciatis nobis assumenda voluptas voluptas.","id":7369532852078809733,"name":"Aperiam quam.","rating":4006897318792835947,"region":"Sit et.","review":"In est.","sweetness":337613569947633606,"updated_at":"2001-05-22T00:40:52-07:00","varietal":"Et qui odio dolore atque.","vineyard":"Ea praesentium repudiandae quia.","vintage":994336159212051070},{"account":{"created_at":"1980-03-06T03:07:52-08:00","created_by":"Dicta impedit est quia corrupti.","href":"Vero facere harum dolores adipisci.","id":8185299197702969036,"name":"Esse quia ratione."},"color":"Quae deleniti fugit.","country":"Dolor est consequuntur sed.","created_at":"2006-10-04T13:31:05-07:00","href":"Voluptatem omnis magni.","id":2562239129571077126,"name":"Praesentium cum quaerat accusamus voluptatem et fugit.","rating":1836711010155437755,"region":"Consequatur ut explicabo libero qui aut.","review":"Deleniti et beatae nisi soluta ex.","sweetness":413883471954645698,"updated_at":"2014-07-23T19:01:04-07:00","varietal":"Rerum dicta quo.","vineyard":"Optio aspernatur modi.","vintage":4509047611644244706},{"account":{"created_at":"1970-06-04T11:54:24-07:00","created_by":"Et et iusto consequatur recusandae.","href":"Vitae libero quis non soluta.","id":5649011730463256100,"name":"Nobis quia dolorum eius quo fugit ab."},"color":"Ad cumque.","country":"Dolorum eos dolore ipsum eius voluptatem.","created_at":"1986-08-26T02:32:51-07:00","href":"Laudantium corrupti et.","id":6012383845116776015,"name":"Modi sed et nulla.","rating":3671730547057169003,"region":"Aperiam amet eum officiis eligendi.","review":"Facere quaerat dicta corporis.","sweetness":551768801793148532,"updated_at":"2008-04-22T03:12:28-07:00","varietal":"Eaque repellat quidem laudantium eaque dignissimos qui.","vineyard":"Sit aut officia pariatur.","vintage":1104408115372112558}]},"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"}},"externalDocs":{"description":"goa guide","url":"http://goa.design/getting-started.html"}}