{
  "openapi" : "3.0.0",
  "servers" : [ {
    "url" : "https://micro-work.net/covid/v1/jhu/",
    "description" : "micro-work/covid/jhu is hosting slave web services.\nconverts CSV data from JHU into JSON and GraphQL\nfilters data from JHU\nenriches historical data with predictions into the future\nThe implementation is work in progress\n"
  } ],
  "info" : {
    "description" : "The micro-work.net/covid web server provides csv and json based get web services to work with covid data provided by john hopkins university as published at github CSSEGISandData/COVID-19",
    "version" : "1.0.0",
    "license" : {
      "name" : "Apache 2.0",
      "url" : "http://www.apache.org/licenses/LICENSE-2.0.html"
    },
    "title" : "mwnet/covid/jhu"
  },
  "tags" : [ {
    "name" : "developers",
    "description" : "Operations available for regular developers, journalists and researchers"
  } ],
  "paths" : {
    "/web.php" : {
      "get" : {
        "tags" : [ "developers" ],
        "summary" : "returns datasource for csv.php, json1.php, json2.php and json3.php",
        "operationId" : "returnSourceUrl",
        "description" : "response.source points to the github url where one can download the source data\n",
        "responses" : {
          "200" : {
            "description" : "return json document with response object",
            "content" : {
              "application/json" : {
                "schema" : {
                  "type" : "object",
                  "items" : {
                    "$ref" : "#/components/schemas/responseWeb"
                  }
                }
              }
            }
          },
          "400" : {
            "description" : "bad input parameter"
          }
        }
      }
    },
    "/csv.php/{filter}" : {
      "get" : {
        "tags" : [ "developers" ],
        "summary" : "retruns daily CSV file from JHU",
        "parameters" : [ {
          "in" : "path",
          "name" : "filter",
          "required" : true,
          "schema" : {
            "type" : "string",
            "description" : "Filters CSV by Country, Region or Date YYYY-MM-DD.\nThe parameter is optional -> Then you get all records\n"
          }
        } ],
        "operationId" : "returnSourceCSV",
        "description" : "CSV of today, filtering by country or date is possible\n",
        "responses" : {
          "200" : {
            "description" : "return CSV document in mime text/csv, number of fields is subject to change",
            "content" : {
              "text/csv" : {
                "schema" : {
                  "type" : "string",
                  "format" : "csv",
                  "items" : {
                    "$ref" : "#/components/schemas/responseCSV"
                  }
                }
              }
            },
            "headers" : {
              "X-Master" : {
                "description" : "The url of the source data",
                "schema" : {
                  "type" : "string",
                  "format" : "url"
                }
              }
            }
          },
          "400" : {
            "description" : "The master data provider changed something"
          }
        }
      }
    },
    "/json1.php" : {
      "get" : {
        "tags" : [ "developers" ],
        "summary" : "returns daily Covid-19 Data in JSON as Array of Array format",
        "operationId" : "returnArrayOfArray",
        "description" : "Array of Array of todays data",
        "responses" : {
          "200" : {
            "description" : "return JSON document in application/json, number of fields is subject to change",
            "content" : {
              "application/json" : {
                "schema" : {
                  "type" : "array",
                  "items" : {
                    "type" : "array",
                    "items" : {
                      "type" : "string"
                    }
                  }
                }
              }
            }
          },
          "400" : {
            "description" : "The master data provider changed something"
          },
          "500" : {
            "description" : "Error at the Web Server"
          }
        }
      }
    },
    "/json2.php/{country}" : {
      "get" : {
        "tags" : [ "developers" ],
        "summary" : "Returns daily Covid-19 Data in JSON as Array of Objects",
        "description" : "Array of Objects of todays data, can be filtered by Country or queried by expression\n",
        "operationId" : "returnArrayOfObjects",
        "parameters" : [ {
          "name" : "country",
          "in" : "path",
          "description" : "Filters data by Country or an Expression",
          "required" : true,
          "schema" : {
            "type" : "string"
          },
          "example" : "Ireland"
        } ],
        "responses" : {
          "200" : {
            "description" : "return JSON document in application/json, number of fields in object is subject to change\n",
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/responseArray"
                }
              }
            }
          },
          "400" : {
            "description" : "The master data provider changed something"
          },
          "500" : {
            "description" : "Error at the Web Server"
          }
        }
      }
    },
    "/json3.php/{country}" : {
      "get" : {
        "tags" : [ "developers" ],
        "summary" : "Returns daily Covid-19 Data in JSON as Object of Objects",
        "description" : "Array of Objects of todays data, can be filtered by Country or queried by expression\n",
        "operationId" : "returnObjectOfObjects",
        "parameters" : [ {
          "name" : "country",
          "in" : "path",
          "description" : "Filters data by Country or an Expression",
          "required" : true,
          "schema" : {
            "type" : "string"
          },
          "example" : "Germany"
        } ],
        "responses" : {
          "200" : {
            "description" : "return JSON document in application/json, number of fields in object is subject to change\n",
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/responseCountry"
                }
              }
            }
          },
          "400" : {
            "description" : "The master data provider changed something"
          },
          "500" : {
            "description" : "Error at the Web Server"
          }
        }
      }
    }
  },
  "components" : {
    "schemas" : {
      "responseWeb" : {
        "type" : "object",
        "required" : [ "filter" ],
        "properties" : {
          "response" : {
            "type" : "object",
            "properties" : {
              "source" : {
                "type" : "string",
                "format" : "url"
              },
              "path" : {
                "type" : "string",
                "format" : "path"
              },
              "name" : {
                "type" : "string",
                "format" : "filename"
              },
              "size" : {
                "type" : "integer"
              },
              "sha" : {
                "type" : "string",
                "format" : "base64"
              },
              "html_url" : {
                "type" : "string",
                "format" : "url"
              }
            }
          }
        }
      },
      "responseCSV" : {
        "type" : "string",
        "format" : "csv",
        "description" : "The master data provider decides (subject to change)",
        "enum" : [ "FIPS", "Admin2", "Province_State", "Country_Region", "Last_Update", "Lat", "Long", "Confirmed", "Deaths", "Recovered", "Active", "Combined_Key" ]
      },
      "responseCountry" : {
        "type" : "string",
        "format" : "json",
        "description" : "The json object depends on the filter"
      },
      "responseArray" : {
        "type" : "array",
        "items" : {
          "$ref" : "#/components/schemas/country"
        }
      },
      "country" : {
        "type" : "object",
        "properties" : {
          "FIPS" : {
            "type" : "string"
          },
          "Admin2" : {
            "type" : "string"
          },
          "Province_State" : {
            "type" : "string"
          },
          "Last_Update" : {
            "type" : "string"
          },
          "Lat" : {
            "type" : "number"
          },
          "Long_" : {
            "type" : "number"
          },
          "Confirmed" : {
            "type" : "number"
          },
          "Deaths" : {
            "type" : "number"
          },
          "Recovered" : {
            "type" : "number"
          },
          "Active" : {
            "type" : "number"
          },
          "Combined_Key" : {
            "type" : "string"
          }
        }
      }
    }
  }
}