{
    "swagger": "2.0",
    "info": {
        "description": "This is a swagger document for the Mail Service developed with NODEJS and Typescript",
        "version": "1.0.0",
        "title": "Mail Service API",
        "contact": {
            "website": "uridiumworks.com"
        },
        "license": {
            "name": "Apache 2.0",
            "url": "http://www.apache.org/licenses/LICENSE-2.0.html"
        }
    },
    "schemes": ["http"],
    "host": "localhost:5000",
    "basePath": "/api",
    "paths": {
        "/mail": {
            "post": {
                "summary": "Send Email",
                "description": "send email to recipent email address",
                "produces": ["application/json"],
                "consumes": ["application/json"],
                "parameters": [
                    {
                        "in": "body",
                        "name": "body",
                        "description": "Message object",
                        "required": true,
                        "schema": {
                            "type": "object",
                            "$ref": "#/definitions/Message"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "schema": {
                            "type": "object",
                            "$ref": "#/definitions/messageResponse"
                        }
                    },
                    "500": {
                        "description": "Invalid Request",
                        "schema": {
                            "$ref": "#/definitions/InvalidResponse"
                        }
                    }
                }
            }
        }
    },
    "definitions": {
        "messageResponse": {
            "type": "object",
            "properties": {
                "status": {
                    "type": "string"
                },
                "message": {
                    "type": "string"
                }
            }
        },
        "Message": {
            "type": "object",
            "properties": {
                "to": {
                    "type": "string",
                    "required": true
                },
                "subject": {
                    "type": "string",
                    "required": true
                },
                "text": {
                    "type": "string",
                    "required": true
                },
                "html": {
                    "type": "string",
                    "required": true
                }
            }
        },
        "InvalidResponse": {
            "type": "object",
            "properties": {
                "status": {
                    "type": "string"
                },
                "detail": {
                    "type": "string"
                }
            }
        }
    }
}
