{
  "openapi": "3.0.3",
  "info": {
    "title": "Smart Sensors",
    "description": "This is the API docs of Smart home app",
    "termsOfService": "http://swagger.io/terms/",
    "license": {
      "name": "Apache 2.0",
      "url": "http://www.apache.org/licenses/LICENSE-2.0.html"
    },
    "version": "1.0.0"
  },
  "externalDocs": {
    "description": "Find out more about Swagger",
    "url": "http://swagger.io"
  },
  "paths": {
    "/sensor-events/{sensorId}": {
      "get": {
        "summary": "Find an event by ID",
        "description": "Returns a single event",
        "operationId": "getEventById",
        "parameters": [
          {
            "name": "sensorId",
            "in": "path",
            "description": "ID of event to return",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "successful",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Event"
                }
              }
            }
          },
          "400": {
            "description": "Invalid ID",
            "content": {}
          },
          "404": {
            "description": "Event not found",
            "content": {}
          }
        }
      }
    },
    "/sensor-events": {
      "post": {
        "summary": "Add a new event",
        "description": "Returns a single event",
        "operationId": "addEvent",
        "requestBody": {
          "description": "New event To Add",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Event"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Event"
                }
              }
            }
          },
          "400": {
            "description": "User Not Found",
            "content": {}
          },
          "404": {
            "description": "Bad Event",
            "content": {}
          },
          "500": {
            "description": "Unknown error occured",
            "content": {}
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Event": {
        "type": "object",
        "required": [
          "temperature",
          "id",
          "weight",
          "status"
        ],
        "properties": {
          "id": {
            "type": "integer",
            "format": "int64"
          },
          "temperature": {
            "type": "integer",
            "format": "int64"
          },
          "weight": {
            "type": "integer",
            "format": "int64"
          },
          "status": {
            "type": "string",
            "format": "string"
          }
        }
      }
    }
  }
}