{ "swagger": "2.0", "info": { "description": "This is an auto-generated API Docs for Golang net/http Template.", "title": "API", "termsOfService": "http://swagger.io/terms/", "contact": { "name": "API Support", "email": "your@mail.com" }, "license": { "name": "Apache 2.0", "url": "http://www.apache.org/licenses/LICENSE-2.0.html" }, "version": "1.0" }, "basePath": "/api", "paths": { "/v1/user": { "put": { "security": [ { "ApiKeyAuth": [] } ], "description": "Update user.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "User" ], "summary": "update user", "parameters": [ { "description": "User ID", "name": "id", "in": "body", "required": true, "schema": { "type": "string" } }, { "description": "User status", "name": "user_status", "in": "body", "required": true, "schema": { "type": "integer" } }, { "description": "User attributes", "name": "user_attrs", "in": "body", "required": true, "schema": { "$ref": "#/definitions/models.UserAttrs" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/models.User" } } } }, "post": { "security": [ { "ApiKeyAuth": [] } ], "description": "Create a new user.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "User" ], "summary": "create a new user", "parameters": [ { "description": "E-mail", "name": "email", "in": "body", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/models.User" } } } }, "delete": { "security": [ { "ApiKeyAuth": [] } ], "description": "Delete user by given ID.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "User" ], "summary": "delete user by given ID", "parameters": [ { "description": "User ID", "name": "id", "in": "body", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "ok", "schema": { "type": "string" } } } } }, "/v1/user/{id}": { "get": { "description": "Get user by given ID.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "User" ], "summary": "get user by given ID", "parameters": [ { "type": "string", "description": "User ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/models.User" } } } } }, "/v1/users": { "get": { "description": "Get all exists users.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Users" ], "summary": "get all exists users", "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/models.User" } } } } } } }, "definitions": { "models.User": { "type": "object", "required": [ "email", "id" ], "properties": { "created_at": { "type": "string" }, "email": { "type": "string" }, "id": { "type": "string" }, "updated_at": { "type": "string" }, "user_attrs": { "$ref": "#/definitions/models.UserAttrs" }, "user_status": { "type": "integer" } } }, "models.UserAttrs": { "type": "object", "properties": { "about": { "type": "string" }, "first_name": { "type": "string" }, "last_name": { "type": "string" }, "picture": { "type": "string" } } } }, "securityDefinitions": { "ApiKeyAuth": { "type": "apiKey", "name": "Authorization", "in": "header" } } }