diff --git a/gatsby-node.js b/gatsby-node.js
index 1dcccac0c..68886f91b 100644
--- a/gatsby-node.js
+++ b/gatsby-node.js
@@ -78,7 +78,8 @@ exports.createPages = async ({ graphql, actions }) => {
})
}
-exports.onCreateWebpackConfig = ({ stage, actions, getConfig }) => {
+exports.onCreateWebpackConfig = ({ stage, actions, loaders, getConfig }) => {
+ const { setWebpackConfig } = actions
if (stage === 'build-javascript') {
const config = getConfig()
const miniCssExtractPlugin = config.plugins.find(
@@ -89,4 +90,17 @@ exports.onCreateWebpackConfig = ({ stage, actions, getConfig }) => {
}
actions.replaceWebpackConfig(config)
}
+
+ if (stage === 'build-html') {
+ setWebpackConfig({
+ module: {
+ rules: [
+ {
+ test: /swagger-ui/,
+ use: loaders.null(),
+ },
+ ],
+ },
+ })
+ }
}
diff --git a/package.json b/package.json
index 2ac5e71c7..185986678 100644
--- a/package.json
+++ b/package.json
@@ -73,6 +73,7 @@
"react-helmet": "^5.2.1",
"react-typography": "^0.16.19",
"slugify": "^1.4.0",
+ "swagger-ui": "^3.25.0",
"typography": "^0.16.19",
"understory": "^1.11.0"
},
diff --git a/src/__tests__/components/common/__snapshots__/swagger-sandbox.js.snap b/src/__tests__/components/common/__snapshots__/swagger-sandbox.js.snap
new file mode 100644
index 000000000..28c53e72a
--- /dev/null
+++ b/src/__tests__/components/common/__snapshots__/swagger-sandbox.js.snap
@@ -0,0 +1,7 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`Components : Common: Swagger sandbox renders correctly 1`] = `
+
+`;
diff --git a/src/__tests__/components/common/swagger-sandbox.js b/src/__tests__/components/common/swagger-sandbox.js
new file mode 100644
index 000000000..1a8c9189d
--- /dev/null
+++ b/src/__tests__/components/common/swagger-sandbox.js
@@ -0,0 +1,19 @@
+import React from 'react'
+import renderer from 'react-test-renderer'
+import SwaggerUI from 'swagger-ui'
+import SwaggerSandbox from '../../../components/common/swagger-sandbox'
+
+beforeEach(() => {
+ window.SwaggerUI = SwaggerUI
+})
+
+describe('Components : Common: Swagger sandbox', () => {
+ it('renders correctly', () => {
+ const tree = renderer.create().toJSON()
+ expect(tree).toMatchSnapshot()
+ })
+})
+
+afterEach(() => {
+ delete window.SwaggerUI
+})
diff --git a/src/components/common/swagger-sandbox.js b/src/components/common/swagger-sandbox.js
new file mode 100644
index 000000000..665f7c81c
--- /dev/null
+++ b/src/components/common/swagger-sandbox.js
@@ -0,0 +1,24 @@
+import React, { useEffect, useRef } from 'react'
+import 'swagger-ui/dist/swagger-ui.css'
+import './swagger-sandbox.scss'
+import SwaggerUI from 'swagger-ui'
+
+const SwaggerSandbox = () => {
+ const swaggerRef = useRef(null)
+
+ useEffect(() => {
+ if (typeof window === 'undefined') {
+ return
+ }
+ SwaggerUI({
+ domNode: swaggerRef.current,
+ url: '/api-docs/COVID-tracking-endpoints-1.0-docs.json',
+ defaultModelExpandDepth: 10,
+ docExpansion: 'list',
+ })
+ }, [])
+
+ return
+}
+
+export default SwaggerSandbox
diff --git a/src/components/common/swagger-sandbox.scss b/src/components/common/swagger-sandbox.scss
new file mode 100644
index 000000000..65cef94d3
--- /dev/null
+++ b/src/components/common/swagger-sandbox.scss
@@ -0,0 +1,114 @@
+@import '../../scss/colors.module.scss';
+@import '../../scss/breakpoints.module.scss';
+
+#swaggerWrapper {
+ .swagger-ui {
+ pre.microlight {
+ line-height: 1rem;
+ }
+
+ .wrapper {
+ padding: 0px;
+ }
+
+ .download-contents {
+ font-size: 0.7rem;
+ line-height: 1.2rem;
+ }
+
+ .model {
+ border:0px;
+
+ td, tr {
+ border-top: none;
+ border-bottom: none;
+ padding-top:20px;
+ padding-bottom:20px;
+ }
+
+ tbody tr {
+ border-top:1px solid rgb(200, 200, 200);
+ }
+ }
+
+ table, th, td {
+ border-color: rgb(175, 175, 175);
+ border-left: none;
+ border-right: none;
+ }
+
+ td {
+ font-size: 0.8rem;
+ }
+
+ tr {
+ line-height: 1.5rem;
+ }
+
+ ul {
+ margin: auto;
+ }
+
+ .url {
+ display: none;
+ }
+
+ .scheme-container {
+ box-shadow: none;
+ padding-top: 0px;
+ margin-top: 0px;
+ }
+
+ select.content-type {
+ border-color: $color-plum-600;
+ }
+
+ .opblock-title span:after,
+ .opblock-summary-method {
+ background-color: $color-plum-600;
+ }
+
+ .btn.execute {
+ background-color: $color-plum-600;
+ border-color: $color-plum-600;
+ }
+
+ .btn.execute:active,
+ .btn.execute:hover {
+ background-color: $color-plum-700;
+ }
+
+ .response-control-media-type__accept-message,
+ .model .prop-type {
+ color: $color-plum-600;
+ }
+
+ .opblock-summary,
+ .opblock-get {
+ background-color: $color-plum-200;
+ border-color: $color-plum-300;
+ border-radius: 2px;
+ }
+
+ @media (max-width: $viewport-ms) {
+ .responses-table,
+ .model {
+ table-layout: fixed;
+ }
+ .col_header.response-col_description {
+ width: 55%;
+ }
+
+ .model td {
+ display: block;
+ padding: 0px;
+ max-width: 100%;
+ }
+
+ .model td:nth-child(2) {
+ margin-bottom: 30px;
+ border-bottom: 0px;
+ }
+ }
+ }
+}
diff --git a/src/pages/data/api-sandbox.js b/src/pages/data/api-sandbox.js
new file mode 100644
index 000000000..30f3d4b8c
--- /dev/null
+++ b/src/pages/data/api-sandbox.js
@@ -0,0 +1,36 @@
+import React from 'react'
+import { graphql } from 'gatsby'
+import SwaggerSandbox from '../../components/common/swagger-sandbox'
+import Layout from '../../components/layout'
+
+export default ({ data }) => (
+
+ Below, you can explore each of our endpoints, try out API requests, and
+ learn about our schema.
+
+
+)
+
+export const query = graphql`
+ query {
+ allContentfulNavigationGroup(filter: { slug: { eq: "data" } }) {
+ edges {
+ node {
+ pages {
+ ... on ContentfulPage {
+ title
+ link: slug
+ }
+ ... on ContentfulNavigationLink {
+ title
+ link: url
+ }
+ }
+ }
+ }
+ }
+ }
+`
diff --git a/static/api-docs/COVID-tracking-endpoints-1.0-docs.json b/static/api-docs/COVID-tracking-endpoints-1.0-docs.json
new file mode 100644
index 000000000..6fba9e04d
--- /dev/null
+++ b/static/api-docs/COVID-tracking-endpoints-1.0-docs.json
@@ -0,0 +1,870 @@
+{
+ "openapi" : "3.0.0",
+ "info" : {
+ "title" : "COVID Tracking API Sandbox",
+ "version" : "1.0"
+ },
+ "servers" : [ {
+ "url" : "https://covidtracking.com"
+ } ],
+ "paths" : {
+ "/api/v1/us/current.{format}" : {
+ "get" : {
+ "tags" : [ "US Current and Historical Data" ],
+ "description" : "US current values.",
+ "parameters" : [ {
+ "in" : "path",
+ "name" : "format",
+ "required" : true,
+ "schema" : {
+ "type" : "string",
+ "example" : "json"
+ }
+ } ],
+ "responses" : {
+ "200" : {
+ "description" : "OK",
+ "content" : {
+ "application/json" : {
+ "schema" : {
+ "type" : "array",
+ "items" : {
+ "$ref" : "#/components/schemas/USData"
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "/api/v1/us/daily.{format}" : {
+ "get" : {
+ "description" : "US historical data. Entries saved each day at 4 pm ET.",
+ "tags" : [ "US Current and Historical Data" ],
+ "parameters" : [ {
+ "in" : "path",
+ "name" : "format",
+ "required" : true,
+ "schema" : {
+ "type" : "string",
+ "example" : "json"
+ }
+ } ],
+ "responses" : {
+ "200" : {
+ "description" : "OK",
+ "content" : {
+ "application/json" : {
+ "schema" : {
+ "type" : "array",
+ "items" : {
+ "$ref" : "#/components/schemas/USHistoricalData"
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "/api/v1/us/{date}.{format}" : {
+ "get" : {
+ "tags" : [ "US Current and Historical Data" ],
+ "description" : "US historical data for a given date.",
+ "parameters" : [ {
+ "in" : "path",
+ "name" : "date",
+ "required" : true,
+ "schema" : {
+ "type" : "string",
+ "example" : 20200408
+ }
+ }, {
+ "in" : "path",
+ "name" : "format",
+ "required" : true,
+ "schema" : {
+ "type" : "string",
+ "example" : "json"
+ }
+ } ],
+ "responses" : {
+ "200" : {
+ "description" : "OK",
+ "content" : {
+ "application/json" : {
+ "schema" : {
+ "$ref" : "#/components/schemas/USHistoricalData"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "/api/v1/states/current.{format}" : {
+ "get" : {
+ "tags" : [ "States Current and Historical Data" ],
+ "description" : "States current values.",
+ "parameters" : [ {
+ "in" : "path",
+ "name" : "format",
+ "required" : true,
+ "schema" : {
+ "type" : "string",
+ "example" : "json"
+ }
+ } ],
+ "responses" : {
+ "200" : {
+ "description" : "OK",
+ "content" : {
+ "application/json" : {
+ "schema" : {
+ "type" : "array",
+ "items" : {
+ "$ref" : "#/components/schemas/StateData"
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "/api/v1/states/{state}/current.{format}" : {
+ "get" : {
+ "tags" : [ "States Current and Historical Data" ],
+ "description" : "States current values.",
+ "parameters" : [ {
+ "in" : "path",
+ "name" : "format",
+ "required" : true,
+ "schema" : {
+ "type" : "string",
+ "example" : "json"
+ }
+ }, {
+ "in" : "path",
+ "name" : "state",
+ "required" : true,
+ "schema" : {
+ "type" : "string",
+ "example" : "CA"
+ }
+ } ],
+ "responses" : {
+ "200" : {
+ "description" : "OK",
+ "content" : {
+ "application/json" : {
+ "schema" : {
+ "$ref" : "#/components/schemas/StateData"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "/api/v1/states/daily.{format}" : {
+ "get" : {
+ "description" : "States historical data. Entries saved each day at 4 pm ET.",
+ "tags" : [ "States Current and Historical Data" ],
+ "parameters" : [ {
+ "in" : "path",
+ "name" : "format",
+ "required" : true,
+ "schema" : {
+ "type" : "string",
+ "example" : "json"
+ }
+ } ],
+ "responses" : {
+ "200" : {
+ "description" : "OK",
+ "content" : {
+ "application/json" : {
+ "schema" : {
+ "type" : "array",
+ "items" : {
+ "$ref" : "#/components/schemas/StateHistoricalData"
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "/api/v1/states/{state}/daily.{format}" : {
+ "get" : {
+ "description" : "State historical data. Entries saved each day at 4 pm ET.",
+ "tags" : [ "States Current and Historical Data" ],
+ "parameters" : [ {
+ "in" : "path",
+ "name" : "state",
+ "required" : true,
+ "schema" : {
+ "type" : "string",
+ "example" : "CA"
+ }
+ }, {
+ "in" : "path",
+ "name" : "format",
+ "required" : true,
+ "schema" : {
+ "type" : "string",
+ "example" : "json"
+ }
+ } ],
+ "responses" : {
+ "200" : {
+ "description" : "OK",
+ "content" : {
+ "application/json" : {
+ "schema" : {
+ "type" : "array",
+ "items" : {
+ "$ref" : "#/components/schemas/StateHistoricalData"
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "/api/v1/states/{state}/{date}.{format}" : {
+ "get" : {
+ "tags" : [ "States Current and Historical Data" ],
+ "description" : "State historical data for a given date.",
+ "parameters" : [ {
+ "in" : "path",
+ "name" : "state",
+ "required" : true,
+ "schema" : {
+ "type" : "string",
+ "example" : "CA"
+ }
+ }, {
+ "in" : "path",
+ "name" : "date",
+ "required" : true,
+ "schema" : {
+ "type" : "string",
+ "example" : 20200408
+ }
+ }, {
+ "in" : "path",
+ "name" : "format",
+ "required" : true,
+ "schema" : {
+ "type" : "string",
+ "example" : "json"
+ }
+ } ],
+ "responses" : {
+ "200" : {
+ "description" : "OK",
+ "content" : {
+ "application/json" : {
+ "schema" : {
+ "$ref" : "#/components/schemas/StateHistoricalData"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "/api/v1/states/info.{format}" : {
+ "get" : {
+ "tags" : [ "Additional Endpoints" ],
+ "description" : "States information.",
+ "parameters" : [ {
+ "in" : "path",
+ "name" : "format",
+ "required" : true,
+ "schema" : {
+ "type" : "string",
+ "example" : "json"
+ }
+ } ],
+ "responses" : {
+ "200" : {
+ "description" : "OK",
+ "content" : {
+ "application/json" : {
+ "schema" : {
+ "type" : "array",
+ "items" : {
+ "$ref" : "#/components/schemas/StateInfo"
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "/api/v1/counties.{format}" : {
+ "get" : {
+ "tags" : [ "Additional Endpoints" ],
+ "description" : "County information.",
+ "parameters" : [ {
+ "in" : "path",
+ "name" : "format",
+ "required" : true,
+ "schema" : {
+ "type" : "string",
+ "example" : "json"
+ }
+ } ],
+ "responses" : {
+ "200" : {
+ "description" : "OK",
+ "content" : {
+ "application/json" : {
+ "schema" : {
+ "type" : "array",
+ "items" : {
+ "$ref" : "#/components/schemas/CountyInfo"
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "/api/v1/cdc/daily.json" : {
+ "get" : {
+ "tags" : [ "Additional Endpoints" ],
+ "description" : "The table found on the 'CDC Testing in U.S.' webpage is available via this endpoint. Please visit the CDC's website to learn more.",
+ "responses" : {
+ "200" : {
+ "description" : "OK",
+ "content" : {
+ "application/json" : {
+ "schema" : {
+ "type" : "array",
+ "items" : {
+ "$ref" : "#/components/schemas/CDCData"
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "/api/v1/urls.json" : {
+ "get" : {
+ "tags" : [ "Additional Endpoints" ],
+ "description" : "Tracker URLs.",
+ "responses" : {
+ "200" : {
+ "description" : "OK",
+ "content" : {
+ "application/json" : {
+ "schema" : {
+ "type" : "array",
+ "items" : {
+ "$ref" : "#/components/schemas/TrackerInfo"
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "/api/v1/states/screenshots.json" : {
+ "get" : {
+ "tags" : [ "Additional Endpoints" ],
+ "description" : "State website screenshots.",
+ "responses" : {
+ "200" : {
+ "description" : "OK",
+ "content" : {
+ "application/json" : {
+ "schema" : {
+ "type" : "array",
+ "items" : {
+ "$ref" : "#/components/schemas/ScreenshotInfo"
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "components" : {
+ "schemas" : {
+ "USData" : {
+ "allOf" : [ {
+ "$ref" : "#/components/schemas/BasicData"
+ } ]
+ },
+ "USHistoricalData" : {
+ "allOf" : [ {
+ "$ref" : "#/components/schemas/BasicHistoricalData"
+ }, {
+ "type" : "object",
+ "properties" : {
+ "states" : {
+ "type" : "integer",
+ "description" : "Quantity of states and territories that are reporting data."
+ },
+ "dateChecked" : {
+ "type" : "string",
+ "nullable" : false,
+ "description" : "ISO 8601 date of when these values were valid.",
+ "example" : "2020-04-29T20:00:00Z"
+ }
+ }
+ } ]
+ },
+ "StateData" : {
+ "allOf" : [ {
+ "$ref" : "#/components/schemas/BasicData"
+ }, {
+ "type" : "object",
+ "properties" : {
+ "state" : {
+ "example" : "AK",
+ "type" : "string",
+ "nullable" : false,
+ "description" : "State or territory postal code abbreviation."
+ },
+ "positiveScore" : {
+ "example" : 1,
+ "type" : "integer",
+ "nullable" : true,
+ "description" : "DEPRECATED +1 for reporting positives reliably."
+ },
+ "negativeScore" : {
+ "example" : 1,
+ "type" : "integer",
+ "nullable" : true,
+ "description" : "DEPRECATED +1 for reporting negatives sometimes."
+ },
+ "negativeRegularScore" : {
+ "example" : 1,
+ "type" : "integer",
+ "nullable" : true,
+ "description" : "DEPRECATED +1 for reporting negatives reliably."
+ },
+ "commercialScore" : {
+ "example" : 1,
+ "type" : "integer",
+ "nullable" : true,
+ "description" : "DEPRECATED +1 for reporting all commercial tests."
+ },
+ "grade" : {
+ "example" : "A",
+ "type" : "string",
+ "nullable" : true,
+ "description" : "DEPRECATED Letter grade based on score."
+ },
+ "score" : {
+ "example" : 4,
+ "type" : "integer",
+ "nullable" : true,
+ "description" : "DEPRECATED Total reporting quality score."
+ },
+ "notes" : {
+ "example" : "Please stop using the \"total\" field. Use \"totalTestResults\" instead. As of 4/24/20, \"grade\" is deprecated. Please use \"dataQualityGrade\" instead.",
+ "type" : "string",
+ "nullable" : true
+ },
+ "dataQualityGrade" : {
+ "example" : "B",
+ "type" : "string",
+ "nullable" : true,
+ "description" : "Letter grade based on our state grading."
+ },
+ "lastUpdateEt" : {
+ "example" : "4/28 14:50",
+ "type" : "string",
+ "nullable" : true
+ },
+ "checkTimeEt" : {
+ "example" : "4/29 16:30",
+ "type" : "string",
+ "nullable" : true
+ },
+ "fips" : {
+ "example" : "02",
+ "type" : "string",
+ "nullable" : true,
+ "description" : "Federal Information Processing Standard state code"
+ },
+ "dateModified" : {
+ "example" : "2020-04-28T18:50:00Z",
+ "type" : "string",
+ "nullable" : true,
+ "description" : "ISO 8601 date of the time the data was last updated by the state."
+ },
+ "dateChecked" : {
+ "example" : "2020-04-29T20:30:00Z",
+ "type" : "string",
+ "nullable" : true,
+ "description" : "ISO 8601 date of the time we last visited their website."
+ }
+ }
+ } ]
+ },
+ "StateHistoricalData" : {
+ "allOf" : [ {
+ "$ref" : "#/components/schemas/BasicHistoricalData"
+ }, {
+ "type" : "object",
+ "properties" : {
+ "state" : {
+ "example" : "AK",
+ "type" : "string",
+ "nullable" : false,
+ "description" : "State or territory postal code abbreviation."
+ },
+ "dateChecked" : {
+ "example" : "2020-04-29T20:30:00Z",
+ "type" : "string",
+ "nullable" : true,
+ "description" : "ISO 8601 date of the time we last visited their website."
+ },
+ "fips" : {
+ "example" : "02",
+ "type" : "string",
+ "nullable" : true,
+ "description" : "Federal Information Processing Standard state code"
+ }
+ }
+ } ]
+ },
+ "CDCData" : {
+ "type" : "object",
+ "properties" : {
+ "dateCollected" : {
+ "type" : "string",
+ "nullable" : false,
+ "example" : "1/26"
+ },
+ "cdcLabs" : {
+ "type" : "integer",
+ "nullable" : false,
+ "example" : 310
+ },
+ "usPubHealthLabs" : {
+ "type" : "integer",
+ "nullable" : false,
+ "example" : 1
+ },
+ "dailyTotal" : {
+ "type" : "integer",
+ "nullable" : false,
+ "example" : 311
+ },
+ "lag" : {
+ "type" : "integer",
+ "nullable" : false,
+ "example" : 0
+ }
+ }
+ },
+ "CountyInfo" : {
+ "type" : "object",
+ "properties" : {
+ "state" : {
+ "type" : "string",
+ "nullable" : false,
+ "description" : "State or territory postal code abbreviation."
+ },
+ "county" : {
+ "type" : "string",
+ "nullable" : false,
+ "description" : "County name."
+ },
+ "covid19Site" : {
+ "type" : "string",
+ "nullable" : true
+ },
+ "dataSite" : {
+ "type" : "string",
+ "nullable" : true
+ },
+ "mainSite" : {
+ "type" : "string",
+ "nullable" : true
+ },
+ "twitter" : {
+ "type" : "string",
+ "nullable" : true
+ },
+ "pui" : {
+ "type" : "string",
+ "nullable" : true,
+ "description" : "Person Under Investigation; it is meant to capture positive, negative, and pending test results.",
+ "example" : "Only positives"
+ }
+ }
+ },
+ "StateInfo" : {
+ "type" : "object",
+ "properties" : {
+ "state" : {
+ "type" : "string",
+ "nullable" : false,
+ "description" : "State or territory postal code abbreviation.",
+ "example" : "CA"
+ },
+ "name" : {
+ "type" : "string",
+ "nullable" : false,
+ "description" : "Full state or territory name.",
+ "example" : "California"
+ },
+ "covid19SiteOld" : {
+ "type" : "string",
+ "nullable" : true
+ },
+ "covid19Site" : {
+ "type" : "string",
+ "nullable" : true,
+ "description" : "Webpage dedicated to making results available to the public. More likely to contain numbers. We make regular screenshots of this URL."
+ },
+ "covid19SiteSecondary" : {
+ "type" : "string",
+ "nullable" : true,
+ "description" : "Typically more informational."
+ },
+ "twitter" : {
+ "type" : "string",
+ "example" : "@CAPublicHealth",
+ "nullable" : true,
+ "description" : "Twitter for the State Health Department."
+ },
+ "pui" : {
+ "type" : "string",
+ "description" : "Person Under Investigation; it is meant to capture positive, negative, and pending test results.",
+ "nullable" : true,
+ "example" : "Only positives"
+ },
+ "pum" : {
+ "type" : "boolean",
+ "nullable" : false,
+ "example" : false,
+ "description" : "Person Under Monitoring; we don’t collect these numbers as they are reported far less consistently across states."
+ },
+ "notes" : {
+ "type" : "string",
+ "nullable" : true,
+ "description" : "Notes about the information available and how we collect or record it."
+ },
+ "fips" : {
+ "type" : "string",
+ "nullable" : false,
+ "example" : "06",
+ "description" : "Federal Information Processing Standard state code."
+ }
+ }
+ },
+ "ScreenshotInfo" : {
+ "type" : "object",
+ "properties" : {
+ "state" : {
+ "type" : "string",
+ "nullable" : false,
+ "description" : "State abbreviation.",
+ "example" : "AK"
+ },
+ "url" : {
+ "type" : "string",
+ "nullable" : false,
+ "description" : "URL of screenshot on covidtracking.com."
+ },
+ "dateChecked" : {
+ "type" : "string",
+ "nullable" : false
+ },
+ "secondary" : {
+ "type" : "boolean",
+ "nullable" : false
+ },
+ "date" : {
+ "type" : "string",
+ "nullable" : false
+ },
+ "size" : {
+ "type" : "integer",
+ "nullable" : false
+ }
+ }
+ },
+ "TrackerInfo" : {
+ "type" : "object",
+ "properties" : {
+ "name" : {
+ "type" : "string",
+ "nullable" : false,
+ "description" : "State name."
+ },
+ "stateId" : {
+ "type" : "string",
+ "nullable" : false,
+ "description" : "State or territory postal code abbreviation."
+ },
+ "url" : {
+ "type" : "string"
+ },
+ "kind" : {
+ "type" : "string"
+ },
+ "filter" : {
+ "type" : "string"
+ }
+ }
+ },
+ "BasicData" : {
+ "type" : "object",
+ "properties" : {
+ "positive" : {
+ "type" : "integer",
+ "description" : "Total cumulative positive test results.",
+ "nullable" : true
+ },
+ "negative" : {
+ "type" : "integer",
+ "description" : "Total cumulative negative test results",
+ "nullable" : true
+ },
+ "pending" : {
+ "type" : "integer",
+ "description" : "Tests that have been submitted to a lab but no results have been reported yet.",
+ "nullable" : true
+ },
+ "hospitalizedCurrently" : {
+ "type" : "integer",
+ "description" : "Number of individuals currently hospitalized.",
+ "nullable" : true
+ },
+ "hospitalizedCumulative" : {
+ "type" : "integer",
+ "description" : "Total number of individuals that have been hospitalized, including those that have been discharged.",
+ "nullable" : true
+ },
+ "inIcuCurrently" : {
+ "type" : "integer",
+ "description" : "Number of individuals currently in an ICU.",
+ "nullable" : true
+ },
+ "inIcuCumulative" : {
+ "type" : "integer",
+ "description" : "Total number of individuals that have been in the ICU.",
+ "nullable" : true
+ },
+ "onVentilatorCurrently" : {
+ "type" : "integer",
+ "description" : "Number of individuals currently on a ventilator.",
+ "nullable" : true
+ },
+ "onVentilatorCumulative" : {
+ "type" : "integer",
+ "description" : "Total number of individuals that have been on a ventilator.",
+ "nullable" : true
+ },
+ "recovered" : {
+ "type" : "integer",
+ "description" : "Total number of individuals that have tested negative after a previous positive test.",
+ "nullable" : true
+ },
+ "hash" : {
+ "example" : "3c87534fcc1b6850241042317032bbc4b3708878",
+ "type" : "string",
+ "description" : "A unique ID changed every time the data updates. Survives a cache reset.",
+ "nullable" : true
+ },
+ "lastModified" : {
+ "example" : "2020-04-30T00:14:51.862Z",
+ "type" : "string",
+ "description" : " The date the API cache was last updated. Even if the values didn’t change but the cache was manually cleared or reset the date will reflect that time of reset and doesn’t necessarily indicate an update was made. Manual cache clearing is rare however.",
+ "nullable" : true
+ },
+ "death" : {
+ "type" : "integer",
+ "description" : "Total cumulative number of people that have died.",
+ "nullable" : true
+ },
+ "hospitalized" : {
+ "type" : "integer",
+ "description" : "Total cumulative number of people hospitalized.",
+ "nullable" : true
+ },
+ "total" : {
+ "type" : "integer",
+ "description" : "DEPRECATED Will be removed in the future. (positive + negative + pending). Pending has been an unstable value and should not count in any totals.",
+ "nullable" : true
+ },
+ "totalTestResults" : {
+ "type" : "integer",
+ "description" : "Calculated value (positive + negative) of total test results.",
+ "nullable" : true
+ },
+ "posNeg" : {
+ "type" : "integer",
+ "description" : "DEPRECATED Renamed to totalTestResults.",
+ "nullable" : true
+ },
+ "notes" : {
+ "example" : "NOTE: \"total\", \"posNeg\", \"hospitalized\" will be removed in the future.",
+ "type" : "string",
+ "nullable" : true
+ }
+ }
+ },
+ "BasicHistoricalData" : {
+ "allOf" : [ {
+ "$ref" : "#/components/schemas/BasicData"
+ }, {
+ "type" : "object",
+ "properties" : {
+ "date" : {
+ "type" : "integer",
+ "nullable" : false,
+ "example" : 20200429
+ },
+ "deathIncrease" : {
+ "type" : "integer",
+ "nullable" : true,
+ "description" : "Increase from the day before."
+ },
+ "hospitalizedIncrease" : {
+ "type" : "integer",
+ "nullable" : true,
+ "description" : "Increase from the day before."
+ },
+ "negativeIncrease" : {
+ "type" : "integer",
+ "nullable" : true,
+ "description" : "Increase from the day before."
+ },
+ "positiveIncrease" : {
+ "type" : "integer",
+ "nullable" : true,
+ "description" : "Increase from the day before."
+ },
+ "totalTestResultsIncrease" : {
+ "type" : "integer",
+ "nullable" : true,
+ "description" : "Increase from the day before."
+ }
+ }
+ } ]
+ }
+ }
+ }
+}
\ No newline at end of file