{ "swagger": "2.0", "info": { "title": "A Bit of Everything", "version": "1.2", "contact": { "name": "gRPC-Gateway project", "url": "https://github.com/grpc-ecosystem/grpc-gateway", "email": "none@example.com" } }, "tags": [ { "name": "SimpleBank" } ], "consumes": [ "application/json" ], "produces": [ "application/json" ], "paths": { "/v1/create_user": { "post": { "summary": "Create a new user", "description": "Use this API to create a new user", "operationId": "SimpleBank_CreateUser", "responses": { "200": { "description": "A successful response.", "schema": { "$ref": "#/definitions/pbCreateUserResponse" } }, "default": { "description": "An unexpected error response.", "schema": { "$ref": "#/definitions/rpcStatus" } } }, "parameters": [ { "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/pbCreateUserRequest" } } ], "tags": [ "SimpleBank" ] } }, "/v1/login_user": { "post": { "summary": "Login a user", "description": "Use this API to login a user and get access token \u0026 refresh token", "operationId": "SimpleBank_LoginUser", "responses": { "200": { "description": "A successful response.", "schema": { "$ref": "#/definitions/pbLoginUserResponse" } }, "default": { "description": "An unexpected error response.", "schema": { "$ref": "#/definitions/rpcStatus" } } }, "parameters": [ { "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/pbLoginUserRequest" } } ], "tags": [ "SimpleBank" ] } }, "/v1/update_user": { "patch": { "summary": "Update user", "description": "Use this API to update user", "operationId": "SimpleBank_UpdateUser", "responses": { "200": { "description": "A successful response.", "schema": { "$ref": "#/definitions/pbUpdateUserResponse" } }, "default": { "description": "An unexpected error response.", "schema": { "$ref": "#/definitions/rpcStatus" } } }, "parameters": [ { "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/pbUpdateUserRequest" } } ], "tags": [ "SimpleBank" ] } } }, "definitions": { "pbCreateUserRequest": { "type": "object", "properties": { "username": { "type": "string" }, "fullName": { "type": "string" }, "email": { "type": "string" }, "password": { "type": "string" } } }, "pbCreateUserResponse": { "type": "object", "properties": { "user": { "$ref": "#/definitions/pbUser" } } }, "pbLoginUserRequest": { "type": "object", "properties": { "username": { "type": "string" }, "password": { "type": "string" } } }, "pbLoginUserResponse": { "type": "object", "properties": { "user": { "$ref": "#/definitions/pbUser" }, "sessionId": { "type": "string" }, "accessToken": { "type": "string" }, "refreshToken": { "type": "string" }, "accessTokenExpiresAt": { "type": "string", "format": "date-time" }, "refreshTokenExpiresAt": { "type": "string", "format": "date-time" } } }, "pbUpdateUserRequest": { "type": "object", "properties": { "username": { "type": "string" }, "fullName": { "type": "string" }, "email": { "type": "string" }, "password": { "type": "string" } } }, "pbUpdateUserResponse": { "type": "object", "properties": { "user": { "$ref": "#/definitions/pbUser" } } }, "pbUser": { "type": "object", "properties": { "username": { "type": "string" }, "fullName": { "type": "string" }, "email": { "type": "string" }, "passwordChangedAt": { "type": "string", "format": "date-time" }, "createdAt": { "type": "string", "format": "date-time" } } }, "protobufAny": { "type": "object", "properties": { "@type": { "type": "string" } }, "additionalProperties": {} }, "rpcStatus": { "type": "object", "properties": { "code": { "type": "integer", "format": "int32" }, "message": { "type": "string" }, "details": { "type": "array", "items": { "type": "object", "$ref": "#/definitions/protobufAny" } } } } } }