Skip to content

Instantly share code, notes, and snippets.

@paulallies
Last active July 1, 2019 12:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save paulallies/07126912edfd9e189647fee1d4fb4149 to your computer and use it in GitHub Desktop.
Save paulallies/07126912edfd9e189647fee1d4fb4149 to your computer and use it in GitHub Desktop.
aag-api
{
"swagger": "2.0",
"info": {
"title": "AAG API",
"version": "1.0.0"
},
"basePath": "/",
"host": "k0e8cq3bgi.execute-api.eu-west-2.amazonaws.com/dev",
"schemes": ["https"],
"consumes": ["application/json"],
"produces": ["application/json"],
"paths": {
"/user": {
"get": {
"responses": {
"200": {
"description": "users retrieved",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/User"
}
},
"headers": {
"Link": {
"description": "contains the link to the next page",
"type": "string"
}
}
}
},
"parameters": [{
"name": "limit",
"in": "query",
"description": "result limit",
"default": "10",
"type": "integer"
}, {
"name": "next",
"in": "query",
"description": "use the Link header to get the next page",
"type": "string"
}],
"x-amazon-apigateway-integration": {
"type": "aws",
"uri": "arn:aws:apigateway:$AWSRegion:lambda:path/2015-03-31/functions/$LambdaArn/invocations",
"httpMethod": "POST",
"requestTemplates": {
"application/json": "{\"fun\": \"getUsers\", \"parameters\": {\"limit\": \"$input.params('limit')\", \"next\": \"$input.params('next')\"}}"
},
"responses": {
"default": {
"statusCode": "200",
"responseParameters": {
"method.response.header.Link": "'TODO'"
},
"responseTemplates": {
"application/json": "$input.json('$.body')"
}
}
}
}
}
}
},
"definitions": {
"Task": {
"type": "object",
"properties": {
"tid": {
"type": "integer"
},
"description": {
"type": "string"
},
"created": {
"type": "integer"
},
"due": {
"type": "integer"
},
"category": {
"type": "string"
},
"completed": {
"type": "integer"
}
},
"required": ["tid", "description", "created"]
},
"CreateTask": {
"type": "object",
"properties": {
"description": {
"type": "string"
},
"due": {
"type": "integer"
},
"category": {
"type": "string"
}
},
"required": ["description"]
},
"User": {
"type": "object",
"properties": {
"uid": {
"type": "string"
},
"email": {
"type": "string"
},
"phone": {
"type": "string"
}
},
"required": ["uid", "email", "phone"]
},
"CreateUser": {
"type": "object",
"properties": {
"email": {
"type": "string"
},
"phone": {
"type": "string"
}
},
"required": ["email", "phone"]
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment