From d2591ad954df717423c09ee7009095761792659a Mon Sep 17 00:00:00 2001 From: DeveloperDurp Date: Sat, 8 Apr 2023 13:10:45 +0000 Subject: [PATCH] Delete docs directory --- docs/docs.go | 1049 ------------------------------------- docs/swagger.json | 1026 ------------------------------------ docs/swagger.yaml | 689 ------------------------ docs/swagger/swagger.yaml | 692 ------------------------ 4 files changed, 3456 deletions(-) delete mode 100644 docs/docs.go delete mode 100644 docs/swagger.json delete mode 100644 docs/swagger.yaml delete mode 100644 docs/swagger/swagger.yaml diff --git a/docs/docs.go b/docs/docs.go deleted file mode 100644 index 4c63f80..0000000 --- a/docs/docs.go +++ /dev/null @@ -1,1049 +0,0 @@ -// Code generated by swaggo/swag. DO NOT EDIT. - -package docs - -import "github.com/swaggo/swag" - -const docTemplate = `{ - "schemes": {{ marshal .Schemes }}, - "swagger": "2.0", - "info": { - "description": "{{escape .Description}}", - "title": "{{.Title}}", - "termsOfService": "http://swagger.io/terms/", - "contact": { - "name": "API Support", - "url": "http://www.swagger.io/support", - "email": "support@swagger.io" - }, - "license": { - "name": "Apache 2.0", - "url": "http://www.apache.org/licenses/LICENSE-2.0.html" - }, - "version": "{{.Version}}" - }, - "host": "{{.Host}}", - "basePath": "{{.BasePath}}", - "paths": { - "/accounts": { - "get": { - "description": "get accounts", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "accounts" - ], - "summary": "List accounts", - "parameters": [ - { - "type": "string", - "format": "email", - "description": "name search by q", - "name": "q", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/model.Account" - } - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/httputil.HTTPError" - } - }, - "404": { - "description": "Not Found", - "schema": { - "$ref": "#/definitions/httputil.HTTPError" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/httputil.HTTPError" - } - } - } - }, - "post": { - "description": "add by json account", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "accounts" - ], - "summary": "Add an account", - "parameters": [ - { - "description": "Add account", - "name": "account", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/model.AddAccount" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/model.Account" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/httputil.HTTPError" - } - }, - "404": { - "description": "Not Found", - "schema": { - "$ref": "#/definitions/httputil.HTTPError" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/httputil.HTTPError" - } - } - } - } - }, - "/accounts/{id}": { - "get": { - "description": "get string by ID", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "accounts" - ], - "summary": "Show an account", - "parameters": [ - { - "type": "integer", - "description": "Account ID", - "name": "id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/model.Account" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/httputil.HTTPError" - } - }, - "404": { - "description": "Not Found", - "schema": { - "$ref": "#/definitions/httputil.HTTPError" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/httputil.HTTPError" - } - } - } - }, - "delete": { - "description": "Delete by account ID", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "accounts" - ], - "summary": "Delete an account", - "parameters": [ - { - "type": "integer", - "format": "int64", - "description": "Account ID", - "name": "id", - "in": "path", - "required": true - } - ], - "responses": { - "204": { - "description": "No Content", - "schema": { - "$ref": "#/definitions/model.Account" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/httputil.HTTPError" - } - }, - "404": { - "description": "Not Found", - "schema": { - "$ref": "#/definitions/httputil.HTTPError" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/httputil.HTTPError" - } - } - } - }, - "patch": { - "description": "Update by json account", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "accounts" - ], - "summary": "Update an account", - "parameters": [ - { - "type": "integer", - "description": "Account ID", - "name": "id", - "in": "path", - "required": true - }, - { - "description": "Update account", - "name": "account", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/model.UpdateAccount" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/model.Account" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/httputil.HTTPError" - } - }, - "404": { - "description": "Not Found", - "schema": { - "$ref": "#/definitions/httputil.HTTPError" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/httputil.HTTPError" - } - } - } - } - }, - "/accounts/{id}/images": { - "post": { - "description": "Upload file", - "consumes": [ - "multipart/form-data" - ], - "produces": [ - "application/json" - ], - "tags": [ - "accounts" - ], - "summary": "Upload account image", - "parameters": [ - { - "type": "integer", - "description": "Account ID", - "name": "id", - "in": "path", - "required": true - }, - { - "type": "file", - "description": "account image", - "name": "file", - "in": "formData", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/controller.Message" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/httputil.HTTPError" - } - }, - "404": { - "description": "Not Found", - "schema": { - "$ref": "#/definitions/httputil.HTTPError" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/httputil.HTTPError" - } - } - } - } - }, - "/admin/auth": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get admin info", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "accounts", - "admin" - ], - "summary": "Auth admin", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/model.Admin" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/httputil.HTTPError" - } - }, - "401": { - "description": "Unauthorized", - "schema": { - "$ref": "#/definitions/httputil.HTTPError" - } - }, - "404": { - "description": "Not Found", - "schema": { - "$ref": "#/definitions/httputil.HTTPError" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/httputil.HTTPError" - } - } - } - } - }, - "/bottles": { - "get": { - "description": "get bottles", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "bottles" - ], - "summary": "List bottles", - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/model.Bottle" - } - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/httputil.HTTPError" - } - }, - "404": { - "description": "Not Found", - "schema": { - "$ref": "#/definitions/httputil.HTTPError" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/httputil.HTTPError" - } - } - } - } - }, - "/bottles/{id}": { - "get": { - "description": "get string by ID", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "bottles" - ], - "summary": "Show a bottle", - "operationId": "get-string-by-int", - "parameters": [ - { - "type": "integer", - "description": "Bottle ID", - "name": "id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/model.Bottle" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/httputil.HTTPError" - } - }, - "404": { - "description": "Not Found", - "schema": { - "$ref": "#/definitions/httputil.HTTPError" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/httputil.HTTPError" - } - } - } - } - }, - "/examples/attribute": { - "get": { - "description": "attribute", - "consumes": [ - "application/json" - ], - "produces": [ - "text/plain" - ], - "tags": [ - "example" - ], - "summary": "attribute example", - "parameters": [ - { - "enum": [ - "A", - "B", - "C" - ], - "type": "string", - "description": "string enums", - "name": "enumstring", - "in": "query" - }, - { - "enum": [ - 1, - 2, - 3 - ], - "type": "integer", - "description": "int enums", - "name": "enumint", - "in": "query" - }, - { - "enum": [ - 1.1, - 1.2, - 1.3 - ], - "type": "number", - "description": "int enums", - "name": "enumnumber", - "in": "query" - }, - { - "maxLength": 10, - "minLength": 5, - "type": "string", - "description": "string valid", - "name": "string", - "in": "query" - }, - { - "maximum": 10, - "minimum": 1, - "type": "integer", - "description": "int valid", - "name": "int", - "in": "query" - }, - { - "type": "string", - "default": "A", - "description": "string default", - "name": "default", - "in": "query" - } - ], - "responses": { - "200": { - "description": "answer", - "schema": { - "type": "string" - } - }, - "400": { - "description": "ok", - "schema": { - "type": "string" - } - }, - "404": { - "description": "ok", - "schema": { - "type": "string" - } - }, - "500": { - "description": "ok", - "schema": { - "type": "string" - } - } - } - } - }, - "/examples/calc": { - "get": { - "description": "plus", - "consumes": [ - "application/json" - ], - "produces": [ - "text/plain" - ], - "tags": [ - "example" - ], - "summary": "calc example", - "parameters": [ - { - "type": "integer", - "description": "used for calc", - "name": "val1", - "in": "query", - "required": true - }, - { - "type": "integer", - "description": "used for calc", - "name": "val2", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "answer", - "schema": { - "type": "integer" - } - }, - "400": { - "description": "ok", - "schema": { - "type": "string" - } - }, - "404": { - "description": "ok", - "schema": { - "type": "string" - } - }, - "500": { - "description": "ok", - "schema": { - "type": "string" - } - } - } - } - }, - "/examples/groups/{group_id}/accounts/{account_id}": { - "get": { - "description": "path params", - "consumes": [ - "application/json" - ], - "produces": [ - "text/plain" - ], - "tags": [ - "example" - ], - "summary": "path params example", - "parameters": [ - { - "type": "integer", - "description": "Group ID", - "name": "group_id", - "in": "path", - "required": true - }, - { - "type": "integer", - "description": "Account ID", - "name": "account_id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "answer", - "schema": { - "type": "string" - } - }, - "400": { - "description": "ok", - "schema": { - "type": "string" - } - }, - "404": { - "description": "ok", - "schema": { - "type": "string" - } - }, - "500": { - "description": "ok", - "schema": { - "type": "string" - } - } - } - } - }, - "/examples/header": { - "get": { - "description": "custome header", - "consumes": [ - "application/json" - ], - "produces": [ - "text/plain" - ], - "tags": [ - "example" - ], - "summary": "custome header example", - "parameters": [ - { - "type": "string", - "description": "Authentication header", - "name": "Authorization", - "in": "header", - "required": true - } - ], - "responses": { - "200": { - "description": "answer", - "schema": { - "type": "string" - } - }, - "400": { - "description": "ok", - "schema": { - "type": "string" - } - }, - "404": { - "description": "ok", - "schema": { - "type": "string" - } - }, - "500": { - "description": "ok", - "schema": { - "type": "string" - } - } - } - } - }, - "/examples/ping": { - "get": { - "description": "do ping", - "consumes": [ - "application/json" - ], - "produces": [ - "text/plain" - ], - "tags": [ - "example" - ], - "summary": "ping example", - "responses": { - "200": { - "description": "pong", - "schema": { - "type": "string" - } - }, - "400": { - "description": "ok", - "schema": { - "type": "string" - } - }, - "404": { - "description": "ok", - "schema": { - "type": "string" - } - }, - "500": { - "description": "ok", - "schema": { - "type": "string" - } - } - } - } - }, - "/examples/post": { - "post": { - "description": "post request example", - "consumes": [ - "application/json" - ], - "produces": [ - "text/plain" - ], - "summary": "post request example", - "parameters": [ - { - "description": "Account Info", - "name": "message", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/model.Account" - } - } - ], - "responses": { - "200": { - "description": "success", - "schema": { - "type": "string" - } - }, - "500": { - "description": "fail", - "schema": { - "type": "string" - } - } - } - } - }, - "/examples/securities": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - }, - { - "OAuth2Implicit": [ - "admin", - "write" - ] - } - ], - "description": "custome header", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "example" - ], - "summary": "custome header example", - "parameters": [ - { - "type": "string", - "description": "Authentication header", - "name": "Authorization", - "in": "header", - "required": true - } - ], - "responses": { - "200": { - "description": "answer", - "schema": { - "type": "string" - } - }, - "400": { - "description": "ok", - "schema": { - "type": "string" - } - }, - "404": { - "description": "ok", - "schema": { - "type": "string" - } - }, - "500": { - "description": "ok", - "schema": { - "type": "string" - } - } - } - } - } - }, - "definitions": { - "controller.Message": { - "type": "object", - "properties": { - "message": { - "type": "string", - "example": "message" - } - } - }, - "httputil.HTTPError": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 400 - }, - "message": { - "type": "string", - "example": "status bad request" - } - } - }, - "model.Account": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int64", - "example": 1 - }, - "name": { - "type": "string", - "example": "account name" - }, - "uuid": { - "type": "string", - "format": "uuid", - "example": "550e8400-e29b-41d4-a716-446655440000" - } - } - }, - "model.AddAccount": { - "type": "object", - "properties": { - "name": { - "type": "string", - "example": "account name" - } - } - }, - "model.Admin": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "example": 1 - }, - "name": { - "type": "string", - "example": "admin name" - } - } - }, - "model.Bottle": { - "type": "object", - "properties": { - "account": { - "$ref": "#/definitions/model.Account" - }, - "id": { - "type": "integer", - "example": 1 - }, - "name": { - "type": "string", - "example": "bottle_name" - } - } - }, - "model.UpdateAccount": { - "type": "object", - "properties": { - "name": { - "type": "string", - "example": "account name" - } - } - } - }, - "securityDefinitions": { - "ApiKeyAuth": { - "description": "Description for what is this security definition being used", - "type": "apiKey", - "name": "Authorization", - "in": "header" - }, - "BasicAuth": { - "type": "basic" - }, - "OAuth2AccessCode": { - "type": "oauth2", - "flow": "accessCode", - "authorizationUrl": "https://example.com/oauth/authorize", - "tokenUrl": "https://example.com/oauth/token", - "scopes": { - "admin": "\t\t\t\t\t\t\tGrants read and write access to administrative information" - } - }, - "OAuth2Application": { - "type": "oauth2", - "flow": "application", - "tokenUrl": "https://example.com/oauth/token", - "scopes": { - "admin": "\t\t\t\t\t\t\tGrants read and write access to administrative information", - "write": "\t\t\t\t\t\t\tGrants write access" - } - }, - "OAuth2Implicit": { - "type": "oauth2", - "flow": "implicit", - "authorizationUrl": "https://example.com/oauth/authorize", - "scopes": { - "admin": "\t\t\t\t\t\t\tGrants read and write access to administrative information", - "write": "\t\t\t\t\t\t\tGrants write access" - } - }, - "OAuth2Password": { - "type": "oauth2", - "flow": "password", - "tokenUrl": "https://example.com/oauth/token", - "scopes": { - "admin": "\t\t\t\t\t\t\tGrants read and write access to administrative information", - "read": "\t\t\t\t\t\t\t\tGrants read access", - "write": "\t\t\t\t\t\t\tGrants write access" - } - } - } -}` - -// SwaggerInfo holds exported Swagger Info so clients can modify it -var SwaggerInfo = &swag.Spec{ - Version: "1.0", - Host: "localhost:8080", - BasePath: "/api/v1", - Schemes: []string{}, - Title: "Swagger Example API", - Description: "This is a sample server celler server.", - InfoInstanceName: "swagger", - SwaggerTemplate: docTemplate, -} - -func init() { - swag.Register(SwaggerInfo.InstanceName(), SwaggerInfo) -} diff --git a/docs/swagger.json b/docs/swagger.json deleted file mode 100644 index 092dbd3..0000000 --- a/docs/swagger.json +++ /dev/null @@ -1,1026 +0,0 @@ -{ - "swagger": "2.0", - "info": { - "description": "This is a sample server celler server.", - "title": "Swagger Example API", - "termsOfService": "http://swagger.io/terms/", - "contact": { - "name": "API Support", - "url": "http://www.swagger.io/support", - "email": "support@swagger.io" - }, - "license": { - "name": "Apache 2.0", - "url": "http://www.apache.org/licenses/LICENSE-2.0.html" - }, - "version": "1.0" - }, - "host": "localhost:8080", - "basePath": "/api/v1", - "paths": { - "/accounts": { - "get": { - "description": "get accounts", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "accounts" - ], - "summary": "List accounts", - "parameters": [ - { - "type": "string", - "format": "email", - "description": "name search by q", - "name": "q", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/model.Account" - } - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/httputil.HTTPError" - } - }, - "404": { - "description": "Not Found", - "schema": { - "$ref": "#/definitions/httputil.HTTPError" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/httputil.HTTPError" - } - } - } - }, - "post": { - "description": "add by json account", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "accounts" - ], - "summary": "Add an account", - "parameters": [ - { - "description": "Add account", - "name": "account", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/model.AddAccount" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/model.Account" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/httputil.HTTPError" - } - }, - "404": { - "description": "Not Found", - "schema": { - "$ref": "#/definitions/httputil.HTTPError" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/httputil.HTTPError" - } - } - } - } - }, - "/accounts/{id}": { - "get": { - "description": "get string by ID", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "accounts" - ], - "summary": "Show an account", - "parameters": [ - { - "type": "integer", - "description": "Account ID", - "name": "id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/model.Account" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/httputil.HTTPError" - } - }, - "404": { - "description": "Not Found", - "schema": { - "$ref": "#/definitions/httputil.HTTPError" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/httputil.HTTPError" - } - } - } - }, - "delete": { - "description": "Delete by account ID", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "accounts" - ], - "summary": "Delete an account", - "parameters": [ - { - "type": "integer", - "format": "int64", - "description": "Account ID", - "name": "id", - "in": "path", - "required": true - } - ], - "responses": { - "204": { - "description": "No Content", - "schema": { - "$ref": "#/definitions/model.Account" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/httputil.HTTPError" - } - }, - "404": { - "description": "Not Found", - "schema": { - "$ref": "#/definitions/httputil.HTTPError" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/httputil.HTTPError" - } - } - } - }, - "patch": { - "description": "Update by json account", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "accounts" - ], - "summary": "Update an account", - "parameters": [ - { - "type": "integer", - "description": "Account ID", - "name": "id", - "in": "path", - "required": true - }, - { - "description": "Update account", - "name": "account", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/model.UpdateAccount" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/model.Account" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/httputil.HTTPError" - } - }, - "404": { - "description": "Not Found", - "schema": { - "$ref": "#/definitions/httputil.HTTPError" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/httputil.HTTPError" - } - } - } - } - }, - "/accounts/{id}/images": { - "post": { - "description": "Upload file", - "consumes": [ - "multipart/form-data" - ], - "produces": [ - "application/json" - ], - "tags": [ - "accounts" - ], - "summary": "Upload account image", - "parameters": [ - { - "type": "integer", - "description": "Account ID", - "name": "id", - "in": "path", - "required": true - }, - { - "type": "file", - "description": "account image", - "name": "file", - "in": "formData", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/controller.Message" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/httputil.HTTPError" - } - }, - "404": { - "description": "Not Found", - "schema": { - "$ref": "#/definitions/httputil.HTTPError" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/httputil.HTTPError" - } - } - } - } - }, - "/admin/auth": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get admin info", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "accounts", - "admin" - ], - "summary": "Auth admin", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/model.Admin" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/httputil.HTTPError" - } - }, - "401": { - "description": "Unauthorized", - "schema": { - "$ref": "#/definitions/httputil.HTTPError" - } - }, - "404": { - "description": "Not Found", - "schema": { - "$ref": "#/definitions/httputil.HTTPError" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/httputil.HTTPError" - } - } - } - } - }, - "/bottles": { - "get": { - "description": "get bottles", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "bottles" - ], - "summary": "List bottles", - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/model.Bottle" - } - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/httputil.HTTPError" - } - }, - "404": { - "description": "Not Found", - "schema": { - "$ref": "#/definitions/httputil.HTTPError" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/httputil.HTTPError" - } - } - } - } - }, - "/bottles/{id}": { - "get": { - "description": "get string by ID", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "bottles" - ], - "summary": "Show a bottle", - "operationId": "get-string-by-int", - "parameters": [ - { - "type": "integer", - "description": "Bottle ID", - "name": "id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/model.Bottle" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/httputil.HTTPError" - } - }, - "404": { - "description": "Not Found", - "schema": { - "$ref": "#/definitions/httputil.HTTPError" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/httputil.HTTPError" - } - } - } - } - }, - "/examples/attribute": { - "get": { - "description": "attribute", - "consumes": [ - "application/json" - ], - "produces": [ - "text/plain" - ], - "tags": [ - "example" - ], - "summary": "attribute example", - "parameters": [ - { - "enum": [ - "A", - "B", - "C" - ], - "type": "string", - "description": "string enums", - "name": "enumstring", - "in": "query" - }, - { - "enum": [ - 1, - 2, - 3 - ], - "type": "integer", - "description": "int enums", - "name": "enumint", - "in": "query" - }, - { - "enum": [ - 1.1, - 1.2, - 1.3 - ], - "type": "number", - "description": "int enums", - "name": "enumnumber", - "in": "query" - }, - { - "maxLength": 10, - "minLength": 5, - "type": "string", - "description": "string valid", - "name": "string", - "in": "query" - }, - { - "maximum": 10, - "minimum": 1, - "type": "integer", - "description": "int valid", - "name": "int", - "in": "query" - }, - { - "type": "string", - "default": "A", - "description": "string default", - "name": "default", - "in": "query" - } - ], - "responses": { - "200": { - "description": "answer", - "schema": { - "type": "string" - } - }, - "400": { - "description": "ok", - "schema": { - "type": "string" - } - }, - "404": { - "description": "ok", - "schema": { - "type": "string" - } - }, - "500": { - "description": "ok", - "schema": { - "type": "string" - } - } - } - } - }, - "/examples/calc": { - "get": { - "description": "plus", - "consumes": [ - "application/json" - ], - "produces": [ - "text/plain" - ], - "tags": [ - "example" - ], - "summary": "calc example", - "parameters": [ - { - "type": "integer", - "description": "used for calc", - "name": "val1", - "in": "query", - "required": true - }, - { - "type": "integer", - "description": "used for calc", - "name": "val2", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "answer", - "schema": { - "type": "integer" - } - }, - "400": { - "description": "ok", - "schema": { - "type": "string" - } - }, - "404": { - "description": "ok", - "schema": { - "type": "string" - } - }, - "500": { - "description": "ok", - "schema": { - "type": "string" - } - } - } - } - }, - "/examples/groups/{group_id}/accounts/{account_id}": { - "get": { - "description": "path params", - "consumes": [ - "application/json" - ], - "produces": [ - "text/plain" - ], - "tags": [ - "example" - ], - "summary": "path params example", - "parameters": [ - { - "type": "integer", - "description": "Group ID", - "name": "group_id", - "in": "path", - "required": true - }, - { - "type": "integer", - "description": "Account ID", - "name": "account_id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "answer", - "schema": { - "type": "string" - } - }, - "400": { - "description": "ok", - "schema": { - "type": "string" - } - }, - "404": { - "description": "ok", - "schema": { - "type": "string" - } - }, - "500": { - "description": "ok", - "schema": { - "type": "string" - } - } - } - } - }, - "/examples/header": { - "get": { - "description": "custome header", - "consumes": [ - "application/json" - ], - "produces": [ - "text/plain" - ], - "tags": [ - "example" - ], - "summary": "custome header example", - "parameters": [ - { - "type": "string", - "description": "Authentication header", - "name": "Authorization", - "in": "header", - "required": true - } - ], - "responses": { - "200": { - "description": "answer", - "schema": { - "type": "string" - } - }, - "400": { - "description": "ok", - "schema": { - "type": "string" - } - }, - "404": { - "description": "ok", - "schema": { - "type": "string" - } - }, - "500": { - "description": "ok", - "schema": { - "type": "string" - } - } - } - } - }, - "/examples/ping": { - "get": { - "description": "do ping", - "consumes": [ - "application/json" - ], - "produces": [ - "text/plain" - ], - "tags": [ - "example" - ], - "summary": "ping example", - "responses": { - "200": { - "description": "pong", - "schema": { - "type": "string" - } - }, - "400": { - "description": "ok", - "schema": { - "type": "string" - } - }, - "404": { - "description": "ok", - "schema": { - "type": "string" - } - }, - "500": { - "description": "ok", - "schema": { - "type": "string" - } - } - } - } - }, - "/examples/post": { - "post": { - "description": "post request example", - "consumes": [ - "application/json" - ], - "produces": [ - "text/plain" - ], - "summary": "post request example", - "parameters": [ - { - "description": "Account Info", - "name": "message", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/model.Account" - } - } - ], - "responses": { - "200": { - "description": "success", - "schema": { - "type": "string" - } - }, - "500": { - "description": "fail", - "schema": { - "type": "string" - } - } - } - } - }, - "/examples/securities": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - }, - { - "OAuth2Implicit": [ - "admin", - "write" - ] - } - ], - "description": "custome header", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "example" - ], - "summary": "custome header example", - "parameters": [ - { - "type": "string", - "description": "Authentication header", - "name": "Authorization", - "in": "header", - "required": true - } - ], - "responses": { - "200": { - "description": "answer", - "schema": { - "type": "string" - } - }, - "400": { - "description": "ok", - "schema": { - "type": "string" - } - }, - "404": { - "description": "ok", - "schema": { - "type": "string" - } - }, - "500": { - "description": "ok", - "schema": { - "type": "string" - } - } - } - } - } - }, - "definitions": { - "controller.Message": { - "type": "object", - "properties": { - "message": { - "type": "string", - "example": "message" - } - } - }, - "httputil.HTTPError": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 400 - }, - "message": { - "type": "string", - "example": "status bad request" - } - } - }, - "model.Account": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int64", - "example": 1 - }, - "name": { - "type": "string", - "example": "account name" - }, - "uuid": { - "type": "string", - "format": "uuid", - "example": "550e8400-e29b-41d4-a716-446655440000" - } - } - }, - "model.AddAccount": { - "type": "object", - "properties": { - "name": { - "type": "string", - "example": "account name" - } - } - }, - "model.Admin": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "example": 1 - }, - "name": { - "type": "string", - "example": "admin name" - } - } - }, - "model.Bottle": { - "type": "object", - "properties": { - "account": { - "$ref": "#/definitions/model.Account" - }, - "id": { - "type": "integer", - "example": 1 - }, - "name": { - "type": "string", - "example": "bottle_name" - } - } - }, - "model.UpdateAccount": { - "type": "object", - "properties": { - "name": { - "type": "string", - "example": "account name" - } - } - } - }, - "securityDefinitions": { - "ApiKeyAuth": { - "description": "Description for what is this security definition being used", - "type": "apiKey", - "name": "Authorization", - "in": "header" - }, - "BasicAuth": { - "type": "basic" - }, - "OAuth2AccessCode": { - "type": "oauth2", - "flow": "accessCode", - "authorizationUrl": "https://example.com/oauth/authorize", - "tokenUrl": "https://example.com/oauth/token", - "scopes": { - "admin": "\t\t\t\t\t\t\tGrants read and write access to administrative information" - } - }, - "OAuth2Application": { - "type": "oauth2", - "flow": "application", - "tokenUrl": "https://example.com/oauth/token", - "scopes": { - "admin": "\t\t\t\t\t\t\tGrants read and write access to administrative information", - "write": "\t\t\t\t\t\t\tGrants write access" - } - }, - "OAuth2Implicit": { - "type": "oauth2", - "flow": "implicit", - "authorizationUrl": "https://example.com/oauth/authorize", - "scopes": { - "admin": "\t\t\t\t\t\t\tGrants read and write access to administrative information", - "write": "\t\t\t\t\t\t\tGrants write access" - } - }, - "OAuth2Password": { - "type": "oauth2", - "flow": "password", - "tokenUrl": "https://example.com/oauth/token", - "scopes": { - "admin": "\t\t\t\t\t\t\tGrants read and write access to administrative information", - "read": "\t\t\t\t\t\t\t\tGrants read access", - "write": "\t\t\t\t\t\t\tGrants write access" - } - } - } -} \ No newline at end of file diff --git a/docs/swagger.yaml b/docs/swagger.yaml deleted file mode 100644 index 9c3bfd7..0000000 --- a/docs/swagger.yaml +++ /dev/null @@ -1,689 +0,0 @@ -basePath: /api/v1 -definitions: - controller.Message: - properties: - message: - example: message - type: string - type: object - httputil.HTTPError: - properties: - code: - example: 400 - type: integer - message: - example: status bad request - type: string - type: object - model.Account: - properties: - id: - example: 1 - format: int64 - type: integer - name: - example: account name - type: string - uuid: - example: 550e8400-e29b-41d4-a716-446655440000 - format: uuid - type: string - type: object - model.AddAccount: - properties: - name: - example: account name - type: string - type: object - model.Admin: - properties: - id: - example: 1 - type: integer - name: - example: admin name - type: string - type: object - model.Bottle: - properties: - account: - $ref: '#/definitions/model.Account' - id: - example: 1 - type: integer - name: - example: bottle_name - type: string - type: object - model.UpdateAccount: - properties: - name: - example: account name - type: string - type: object -host: localhost:8080 -info: - contact: - email: support@swagger.io - name: API Support - url: http://www.swagger.io/support - description: This is a sample server celler server. - license: - name: Apache 2.0 - url: http://www.apache.org/licenses/LICENSE-2.0.html - termsOfService: http://swagger.io/terms/ - title: Swagger Example API - version: "1.0" -paths: - /accounts: - get: - consumes: - - application/json - description: get accounts - parameters: - - description: name search by q - format: email - in: query - name: q - type: string - produces: - - application/json - responses: - "200": - description: OK - schema: - items: - $ref: '#/definitions/model.Account' - type: array - "400": - description: Bad Request - schema: - $ref: '#/definitions/httputil.HTTPError' - "404": - description: Not Found - schema: - $ref: '#/definitions/httputil.HTTPError' - "500": - description: Internal Server Error - schema: - $ref: '#/definitions/httputil.HTTPError' - summary: List accounts - tags: - - accounts - post: - consumes: - - application/json - description: add by json account - parameters: - - description: Add account - in: body - name: account - required: true - schema: - $ref: '#/definitions/model.AddAccount' - produces: - - application/json - responses: - "200": - description: OK - schema: - $ref: '#/definitions/model.Account' - "400": - description: Bad Request - schema: - $ref: '#/definitions/httputil.HTTPError' - "404": - description: Not Found - schema: - $ref: '#/definitions/httputil.HTTPError' - "500": - description: Internal Server Error - schema: - $ref: '#/definitions/httputil.HTTPError' - summary: Add an account - tags: - - accounts - /accounts/{id}: - delete: - consumes: - - application/json - description: Delete by account ID - parameters: - - description: Account ID - format: int64 - in: path - name: id - required: true - type: integer - produces: - - application/json - responses: - "204": - description: No Content - schema: - $ref: '#/definitions/model.Account' - "400": - description: Bad Request - schema: - $ref: '#/definitions/httputil.HTTPError' - "404": - description: Not Found - schema: - $ref: '#/definitions/httputil.HTTPError' - "500": - description: Internal Server Error - schema: - $ref: '#/definitions/httputil.HTTPError' - summary: Delete an account - tags: - - accounts - get: - consumes: - - application/json - description: get string by ID - parameters: - - description: Account ID - in: path - name: id - required: true - type: integer - produces: - - application/json - responses: - "200": - description: OK - schema: - $ref: '#/definitions/model.Account' - "400": - description: Bad Request - schema: - $ref: '#/definitions/httputil.HTTPError' - "404": - description: Not Found - schema: - $ref: '#/definitions/httputil.HTTPError' - "500": - description: Internal Server Error - schema: - $ref: '#/definitions/httputil.HTTPError' - summary: Show an account - tags: - - accounts - patch: - consumes: - - application/json - description: Update by json account - parameters: - - description: Account ID - in: path - name: id - required: true - type: integer - - description: Update account - in: body - name: account - required: true - schema: - $ref: '#/definitions/model.UpdateAccount' - produces: - - application/json - responses: - "200": - description: OK - schema: - $ref: '#/definitions/model.Account' - "400": - description: Bad Request - schema: - $ref: '#/definitions/httputil.HTTPError' - "404": - description: Not Found - schema: - $ref: '#/definitions/httputil.HTTPError' - "500": - description: Internal Server Error - schema: - $ref: '#/definitions/httputil.HTTPError' - summary: Update an account - tags: - - accounts - /accounts/{id}/images: - post: - consumes: - - multipart/form-data - description: Upload file - parameters: - - description: Account ID - in: path - name: id - required: true - type: integer - - description: account image - in: formData - name: file - required: true - type: file - produces: - - application/json - responses: - "200": - description: OK - schema: - $ref: '#/definitions/controller.Message' - "400": - description: Bad Request - schema: - $ref: '#/definitions/httputil.HTTPError' - "404": - description: Not Found - schema: - $ref: '#/definitions/httputil.HTTPError' - "500": - description: Internal Server Error - schema: - $ref: '#/definitions/httputil.HTTPError' - summary: Upload account image - tags: - - accounts - /admin/auth: - post: - consumes: - - application/json - description: get admin info - produces: - - application/json - responses: - "200": - description: OK - schema: - $ref: '#/definitions/model.Admin' - "400": - description: Bad Request - schema: - $ref: '#/definitions/httputil.HTTPError' - "401": - description: Unauthorized - schema: - $ref: '#/definitions/httputil.HTTPError' - "404": - description: Not Found - schema: - $ref: '#/definitions/httputil.HTTPError' - "500": - description: Internal Server Error - schema: - $ref: '#/definitions/httputil.HTTPError' - security: - - ApiKeyAuth: [] - summary: Auth admin - tags: - - accounts - - admin - /bottles: - get: - consumes: - - application/json - description: get bottles - produces: - - application/json - responses: - "200": - description: OK - schema: - items: - $ref: '#/definitions/model.Bottle' - type: array - "400": - description: Bad Request - schema: - $ref: '#/definitions/httputil.HTTPError' - "404": - description: Not Found - schema: - $ref: '#/definitions/httputil.HTTPError' - "500": - description: Internal Server Error - schema: - $ref: '#/definitions/httputil.HTTPError' - summary: List bottles - tags: - - bottles - /bottles/{id}: - get: - consumes: - - application/json - description: get string by ID - operationId: get-string-by-int - parameters: - - description: Bottle ID - in: path - name: id - required: true - type: integer - produces: - - application/json - responses: - "200": - description: OK - schema: - $ref: '#/definitions/model.Bottle' - "400": - description: Bad Request - schema: - $ref: '#/definitions/httputil.HTTPError' - "404": - description: Not Found - schema: - $ref: '#/definitions/httputil.HTTPError' - "500": - description: Internal Server Error - schema: - $ref: '#/definitions/httputil.HTTPError' - summary: Show a bottle - tags: - - bottles - /examples/attribute: - get: - consumes: - - application/json - description: attribute - parameters: - - description: string enums - enum: - - A - - B - - C - in: query - name: enumstring - type: string - - description: int enums - enum: - - 1 - - 2 - - 3 - in: query - name: enumint - type: integer - - description: int enums - enum: - - 1.1 - - 1.2 - - 1.3 - in: query - name: enumnumber - type: number - - description: string valid - in: query - maxLength: 10 - minLength: 5 - name: string - type: string - - description: int valid - in: query - maximum: 10 - minimum: 1 - name: int - type: integer - - default: A - description: string default - in: query - name: default - type: string - produces: - - text/plain - responses: - "200": - description: answer - schema: - type: string - "400": - description: ok - schema: - type: string - "404": - description: ok - schema: - type: string - "500": - description: ok - schema: - type: string - summary: attribute example - tags: - - example - /examples/calc: - get: - consumes: - - application/json - description: plus - parameters: - - description: used for calc - in: query - name: val1 - required: true - type: integer - - description: used for calc - in: query - name: val2 - required: true - type: integer - produces: - - text/plain - responses: - "200": - description: answer - schema: - type: integer - "400": - description: ok - schema: - type: string - "404": - description: ok - schema: - type: string - "500": - description: ok - schema: - type: string - summary: calc example - tags: - - example - /examples/groups/{group_id}/accounts/{account_id}: - get: - consumes: - - application/json - description: path params - parameters: - - description: Group ID - in: path - name: group_id - required: true - type: integer - - description: Account ID - in: path - name: account_id - required: true - type: integer - produces: - - text/plain - responses: - "200": - description: answer - schema: - type: string - "400": - description: ok - schema: - type: string - "404": - description: ok - schema: - type: string - "500": - description: ok - schema: - type: string - summary: path params example - tags: - - example - /examples/header: - get: - consumes: - - application/json - description: custome header - parameters: - - description: Authentication header - in: header - name: Authorization - required: true - type: string - produces: - - text/plain - responses: - "200": - description: answer - schema: - type: string - "400": - description: ok - schema: - type: string - "404": - description: ok - schema: - type: string - "500": - description: ok - schema: - type: string - summary: custome header example - tags: - - example - /examples/ping: - get: - consumes: - - application/json - description: do ping - produces: - - text/plain - responses: - "200": - description: pong - schema: - type: string - "400": - description: ok - schema: - type: string - "404": - description: ok - schema: - type: string - "500": - description: ok - schema: - type: string - summary: ping example - tags: - - example - /examples/post: - post: - consumes: - - application/json - description: post request example - parameters: - - description: Account Info - in: body - name: message - required: true - schema: - $ref: '#/definitions/model.Account' - produces: - - text/plain - responses: - "200": - description: success - schema: - type: string - "500": - description: fail - schema: - type: string - summary: post request example - /examples/securities: - get: - consumes: - - application/json - description: custome header - parameters: - - description: Authentication header - in: header - name: Authorization - required: true - type: string - produces: - - application/json - responses: - "200": - description: answer - schema: - type: string - "400": - description: ok - schema: - type: string - "404": - description: ok - schema: - type: string - "500": - description: ok - schema: - type: string - security: - - ApiKeyAuth: [] - - OAuth2Implicit: - - admin - - write - summary: custome header example - tags: - - example -securityDefinitions: - ApiKeyAuth: - description: Description for what is this security definition being used - in: header - name: Authorization - type: apiKey - BasicAuth: - type: basic - OAuth2AccessCode: - authorizationUrl: https://example.com/oauth/authorize - flow: accessCode - scopes: - admin: "\t\t\t\t\t\t\tGrants read and write access to administrative information" - tokenUrl: https://example.com/oauth/token - type: oauth2 - OAuth2Application: - flow: application - scopes: - admin: "\t\t\t\t\t\t\tGrants read and write access to administrative information" - write: "\t\t\t\t\t\t\tGrants write access" - tokenUrl: https://example.com/oauth/token - type: oauth2 - OAuth2Implicit: - authorizationUrl: https://example.com/oauth/authorize - flow: implicit - scopes: - admin: "\t\t\t\t\t\t\tGrants read and write access to administrative information" - write: "\t\t\t\t\t\t\tGrants write access" - type: oauth2 - OAuth2Password: - flow: password - scopes: - admin: "\t\t\t\t\t\t\tGrants read and write access to administrative information" - read: "\t\t\t\t\t\t\t\tGrants read access" - write: "\t\t\t\t\t\t\tGrants write access" - tokenUrl: https://example.com/oauth/token - type: oauth2 -swagger: "2.0" diff --git a/docs/swagger/swagger.yaml b/docs/swagger/swagger.yaml deleted file mode 100644 index e9deea7..0000000 --- a/docs/swagger/swagger.yaml +++ /dev/null @@ -1,692 +0,0 @@ -basePath: /api/v1 -definitions: - controller.Message: - properties: - message: - example: message - type: string - type: object - httputil.HTTPError: - properties: - code: - example: 400 - type: integer - message: - example: status bad request - type: string - type: object - model.Account: - properties: - id: - example: 1 - format: int64 - type: integer - name: - example: account name - type: string - uuid: - example: 550e8400-e29b-41d4-a716-446655440000 - format: uuid - type: string - type: object - model.AddAccount: - properties: - name: - example: account name - type: string - type: object - model.Admin: - properties: - id: - example: 1 - type: integer - name: - example: admin name - type: string - type: object - model.Bottle: - properties: - account: - $ref: '#/definitions/model.Account' - id: - example: 1 - type: integer - name: - example: bottle_name - type: string - type: object - model.UpdateAccount: - properties: - name: - example: account name - type: string - type: object -host: localhost:8080 -info: - contact: - email: support@swagger.io - name: API Support - url: http://www.swagger.io/support - description: This is a sample server celler server. - license: - name: Apache 2.0 - url: http://www.apache.org/licenses/LICENSE-2.0.html - termsOfService: http://swagger.io/terms/ - title: Swagger Example API - version: "1.0" -paths: - /accounts: - get: - consumes: - - application/json - description: get accounts - parameters: - - description: name search by q - format: email - in: query - name: q - type: string - produces: - - application/json - responses: - "200": - description: OK - schema: - items: - $ref: '#/definitions/model.Account' - type: array - "400": - description: Bad Request - schema: - $ref: '#/definitions/httputil.HTTPError' - "404": - description: Not Found - schema: - $ref: '#/definitions/httputil.HTTPError' - "500": - description: Internal Server Error - schema: - $ref: '#/definitions/httputil.HTTPError' - summary: List accounts - tags: - - accounts - post: - consumes: - - application/json - description: add by json account - parameters: - - description: Add account - in: body - name: account - required: true - schema: - $ref: '#/definitions/model.AddAccount' - produces: - - application/json - responses: - "200": - description: OK - schema: - $ref: '#/definitions/model.Account' - "400": - description: Bad Request - schema: - $ref: '#/definitions/httputil.HTTPError' - "404": - description: Not Found - schema: - $ref: '#/definitions/httputil.HTTPError' - "500": - description: Internal Server Error - schema: - $ref: '#/definitions/httputil.HTTPError' - summary: Add an account - tags: - - accounts - /accounts/{id}: - delete: - consumes: - - application/json - description: Delete by account ID - parameters: - - description: Account ID - format: int64 - in: path - name: id - required: true - type: integer - produces: - - application/json - responses: - "204": - description: No Content - schema: - $ref: '#/definitions/model.Account' - "400": - description: Bad Request - schema: - $ref: '#/definitions/httputil.HTTPError' - "404": - description: Not Found - schema: - $ref: '#/definitions/httputil.HTTPError' - "500": - description: Internal Server Error - schema: - $ref: '#/definitions/httputil.HTTPError' - summary: Delete an account - tags: - - accounts - get: - consumes: - - application/json - description: get string by ID - parameters: - - description: Account ID - in: path - name: id - required: true - type: integer - produces: - - application/json - responses: - "200": - description: OK - schema: - $ref: '#/definitions/model.Account' - "400": - description: Bad Request - schema: - $ref: '#/definitions/httputil.HTTPError' - "404": - description: Not Found - schema: - $ref: '#/definitions/httputil.HTTPError' - "500": - description: Internal Server Error - schema: - $ref: '#/definitions/httputil.HTTPError' - summary: Show an account - tags: - - accounts - patch: - consumes: - - application/json - description: Update by json account - parameters: - - description: Account ID - in: path - name: id - required: true - type: integer - - description: Update account - in: body - name: account - required: true - schema: - $ref: '#/definitions/model.UpdateAccount' - produces: - - application/json - responses: - "200": - description: OK - schema: - $ref: '#/definitions/model.Account' - "400": - description: Bad Request - schema: - $ref: '#/definitions/httputil.HTTPError' - "404": - description: Not Found - schema: - $ref: '#/definitions/httputil.HTTPError' - "500": - description: Internal Server Error - schema: - $ref: '#/definitions/httputil.HTTPError' - summary: Update an account - tags: - - accounts - /accounts/{id}/images: - post: - consumes: - - multipart/form-data - description: Upload file - parameters: - - description: Account ID - in: path - name: id - required: true - type: integer - - description: account image - in: formData - name: file - required: true - type: file - produces: - - application/json - responses: - "200": - description: OK - schema: - $ref: '#/definitions/controller.Message' - "400": - description: Bad Request - schema: - $ref: '#/definitions/httputil.HTTPError' - "404": - description: Not Found - schema: - $ref: '#/definitions/httputil.HTTPError' - "500": - description: Internal Server Error - schema: - $ref: '#/definitions/httputil.HTTPError' - summary: Upload account image - tags: - - accounts - /admin/auth: - post: - consumes: - - application/json - description: get admin info - produces: - - application/json - responses: - "200": - description: OK - schema: - $ref: '#/definitions/model.Admin' - "400": - description: Bad Request - schema: - $ref: '#/definitions/httputil.HTTPError' - "401": - description: Unauthorized - schema: - $ref: '#/definitions/httputil.HTTPError' - "404": - description: Not Found - schema: - $ref: '#/definitions/httputil.HTTPError' - "500": - description: Internal Server Error - schema: - $ref: '#/definitions/httputil.HTTPError' - security: - - ApiKeyAuth: [] - summary: Auth admin - tags: - - accounts - - admin - /bottles: - get: - consumes: - - application/json - description: get bottles - produces: - - application/json - responses: - "200": - description: OK - schema: - items: - $ref: '#/definitions/model.Bottle' - type: array - "400": - description: Bad Request - schema: - $ref: '#/definitions/httputil.HTTPError' - "404": - description: Not Found - schema: - $ref: '#/definitions/httputil.HTTPError' - "500": - description: Internal Server Error - schema: - $ref: '#/definitions/httputil.HTTPError' - summary: List bottles - tags: - - bottles - /bottles/{id}: - get: - consumes: - - application/json - description: get string by ID - operationId: get-string-by-int - parameters: - - description: Bottle ID - in: path - name: id - required: true - type: integer - produces: - - application/json - responses: - "200": - description: OK - schema: - $ref: '#/definitions/model.Bottle' - "400": - description: Bad Request - schema: - $ref: '#/definitions/httputil.HTTPError' - "404": - description: Not Found - schema: - $ref: '#/definitions/httputil.HTTPError' - "500": - description: Internal Server Error - schema: - $ref: '#/definitions/httputil.HTTPError' - summary: Show a bottle - tags: - - bottles - /examples/attribute: - get: - consumes: - - application/json - description: attribute - parameters: - - description: string enums - enum: - - A - - B - - C - in: query - name: enumstring - type: string - - description: int enums - enum: - - 1 - - 2 - - 3 - in: query - name: enumint - type: integer - - description: int enums - enum: - - 1.1 - - 1.2 - - 1.3 - in: query - name: enumnumber - type: number - - description: string valid - in: query - maxLength: 10 - minLength: 5 - name: string - type: string - - description: int valid - in: query - maximum: 10 - minimum: 1 - name: int - type: integer - - default: A - description: string default - in: query - name: default - type: string - produces: - - application/json - responses: - "200": - description: answer - schema: - type: string - "400": - description: ok - schema: - type: string - "404": - description: ok - schema: - type: string - "500": - description: ok - schema: - type: string - summary: attribute example - tags: - - example - /examples/calc: - get: - consumes: - - application/json - description: plus - parameters: - - description: used for calc - in: query - name: val1 - required: true - type: integer - - description: used for calc - in: query - name: val2 - required: true - type: integer - produces: - - application/json - responses: - "200": - description: answer - schema: - type: integer - "400": - description: ok - schema: - type: string - "404": - description: ok - schema: - type: string - "500": - description: ok - schema: - type: string - summary: calc example - tags: - - example - /examples/groups/{group_id}/accounts/{account_id}: - get: - consumes: - - application/json - description: path params - parameters: - - description: Group ID - in: path - name: group_id - required: true - type: integer - - description: Account ID - in: path - name: account_id - required: true - type: integer - produces: - - application/json - responses: - "200": - description: answer - schema: - type: string - "400": - description: ok - schema: - type: string - "404": - description: ok - schema: - type: string - "500": - description: ok - schema: - type: string - summary: path params example - tags: - - example - /examples/header: - get: - consumes: - - application/json - description: custome header - parameters: - - description: Authentication header - in: header - name: Authorization - required: true - type: string - produces: - - application/json - responses: - "200": - description: answer - schema: - type: string - "400": - description: ok - schema: - type: string - "404": - description: ok - schema: - type: string - "500": - description: ok - schema: - type: string - summary: custome header example - tags: - - example - /examples/ping: - get: - consumes: - - application/json - description: do ping - produces: - - application/json - responses: - "200": - description: pong - schema: - type: string - "400": - description: ok - schema: - type: string - "404": - description: ok - schema: - type: string - "500": - description: ok - schema: - type: string - summary: ping example - tags: - - example - /examples/post: - post: - consumes: - - application/json - description: post request example - parameters: - - description: Account Info - in: body - name: message - required: true - schema: - $ref: '#/definitions/model.Account' - produces: - - text/plain - responses: - "200": - description: success - schema: - type: string - "500": - description: fail - schema: - type: string - summary: post request example - /examples/securities: - get: - consumes: - - application/json - description: custome header - parameters: - - description: Authentication header - in: header - name: Authorization - required: true - type: string - produces: - - application/json - responses: - "200": - description: answer - schema: - type: string - "400": - description: ok - schema: - type: string - "404": - description: ok - schema: - type: string - "500": - description: ok - schema: - type: string - security: - - ApiKeyAuth: [] - - OAuth2Implicit: - - admin - - write - summary: custome header example - tags: - - example -securityDefinitions: - ApiKeyAuth: - in: header - name: Authorization - type: apiKey - BasicAuth: - type: basic - OAuth2AccessCode: - authorizationUrl: https://example.com/oauth/authorize - flow: accessCode - scopes: - admin: ' Grants read and write access to administrative - information' - tokenUrl: https://example.com/oauth/token - type: oauth2 - OAuth2Application: - flow: application - scopes: - admin: ' Grants read and write access to administrative - information' - write: ' Grants write access' - tokenUrl: https://example.com/oauth/token - type: oauth2 - OAuth2Implicit: - authorizationUrl: https://example.com/oauth/authorize - flow: implicit - scopes: - admin: ' Grants read and write access to administrative - information' - write: ' Grants write access' - type: oauth2 - OAuth2Password: - flow: password - scopes: - admin: ' Grants read and write access to administrative - information' - read: ' Grants read access' - write: ' Grants write access' - tokenUrl: https://example.com/oauth/token - type: oauth2 -swagger: "2.0"