Skip to content

Instantly share code, notes, and snippets.

@rmtuckerphx
Created July 28, 2020 20:01
Show Gist options
  • Save rmtuckerphx/9a6d4475377f59334ffe0a83e64cd2e4 to your computer and use it in GitHub Desktop.
Save rmtuckerphx/9a6d4475377f59334ffe0a83e64cd2e4 to your computer and use it in GitHub Desktop.
{
"openapi": "3.0.0",
"info": {
"title": "Task to perform a count down",
"version": "1",
"x-amzn-alexa-access-scope": "public"
},
"tags": [
{
"name": "count down"
}
],
"paths": {
"/CountDown": {
"summary": "Count Down",
"description": "To start a count down",
"post": {
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Input"
},
"examples": {
"countdownTenToOne": {
"summary": "Example input for countdown from 10 to 1.",
"description": "The example inputs are used for validation of the task",
"value": {
"upperLimit": 10,
"lowerLimit": 1
}
},
"countdownHundredToNinety": {
"summary": "Example input for countdown from 100 to 90",
"description": "The example inputs are used for validation of the task",
"value": {
"upperLimit": 100,
"lowerLimit": 90
}
}
}
}
}
},
"responses": {
"200": {
"description": "When the count down finishes successfully",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/SuccessfulResponse"
}
}
}
},
"400": {
"description": "When the given parameters fail validations - e.g. lowerLimit cannot be higher than upperLimit"
},
"500": {
"description": "When the count down fails"
}
}
}
}
},
"components": {
"schemas": {
"Input": {
"type": "object",
"properties": {
"upperLimit": {
"type": "number",
"maximum": 100,
"minimum": 1
},
"lowerLimit": {
"type": "number",
"maximum": 100,
"minimum": 1
}
}
},
"SuccessfulResponse": {
"type": "object",
"properties": {
"endTime": {
"type": "string",
"format": "date-time"
}
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment