Created
December 23, 2016 01:38
-
-
Save gojko/f19f61c19900d3b210cf5361da075509 to your computer and use it in GitHub Desktop.
swagger equivalent of https://github.com/claudiajs/example-projects/blob/master/api-gw-geolocation/api.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
swagger: "2.0" | |
info: | |
version: "2016-12-23T01:28:46Z" | |
title: "geoip" | |
host: "xxxxx.execute-api.us-east-1.amazonaws.com" | |
basePath: "/prod" | |
schemes: | |
- "https" | |
paths: | |
/: | |
get: | |
consumes: | |
- "application/json" | |
produces: | |
- "application/json" | |
responses: | |
200: | |
description: "200 response" | |
schema: | |
$ref: "#/definitions/Empty" | |
headers: | |
Access-Control-Allow-Origin: | |
type: "string" | |
x-amazon-apigateway-integration: | |
responses: | |
default: | |
statusCode: "200" | |
responseParameters: | |
method.response.header.Access-Control-Allow-Origin: "'*'" | |
responseTemplates: | |
application/json: "{\n\"country\":\"$input.params().get('header').get('CloudFront-Viewer-Country')\"\ | |
,\n\"ip\": \"$context.identity.sourceIp\"\n}" | |
requestTemplates: | |
application/json: "{\"statusCode\": 200}" | |
passthroughBehavior: "when_no_match" | |
type: "mock" | |
options: | |
consumes: | |
- "application/json" | |
produces: | |
- "application/json" | |
responses: | |
200: | |
description: "200 response" | |
schema: | |
$ref: "#/definitions/Empty" | |
headers: | |
Access-Control-Allow-Origin: | |
type: "string" | |
Access-Control-Allow-Methods: | |
type: "string" | |
Access-Control-Max-Age: | |
type: "string" | |
Access-Control-Allow-Headers: | |
type: "string" | |
x-amazon-apigateway-integration: | |
responses: | |
default: | |
statusCode: "200" | |
requestTemplates: | |
application/json: "{\"statusCode\": 200}" | |
passthroughBehavior: "when_no_match" | |
type: "mock" | |
definitions: | |
Empty: | |
type: "object" | |
title: "Empty Schema" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment