{ "schemes": [ "http", "https" ], "swagger": "2.0", "info": { "description": "API for API Template application", "title": "API Template", "termsOfService": "http://swagger.io/terms/", "contact": { "name": "API Support", "email": "support@example.com" }, "license": { "name": "MIT", "url": "https://opensource.org/licenses/MIT" }, "version": "1.0" }, "host": "localhost:8080", "basePath": "/v1", "paths": { "/v1/auth/register": { "post": { "description": "Register a new user account", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "auth" ], "summary": "Create a new user", "parameters": [ { "description": "User registration details", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/api.createUserRequest" } } ], "responses": { "201": { "description": "Created", "schema": { "allOf": [ { "$ref": "#/definitions/util.JSONResponse" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/api.userResponse" } } } ] } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/util.JSONResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/util.JSONResponse" } } } } } }, "definitions": { "api.createUserRequest": { "type": "object", "required": [ "email", "full_name", "password", "username" ], "properties": { "email": { "type": "string" }, "full_name": { "type": "string" }, "password": { "type": "string", "minLength": 6 }, "username": { "type": "string" } } }, "api.userResponse": { "type": "object", "properties": { "created_at": { "type": "string" }, "email": { "type": "string" }, "full_name": { "type": "string" }, "password_changed_at": { "type": "string" }, "username": { "type": "string" } } }, "util.JSONResponse": { "type": "object", "properties": { "data": {}, "error": { "type": "string" }, "message": { "type": "string" }, "success": { "type": "boolean" } } } }, "securityDefinitions": { "BearerAuth": { "description": "Type \"Bearer\" followed by a space and JWT token.", "type": "apiKey", "name": "Authorization", "in": "header" } } }