Skip to content

Instantly share code, notes, and snippets.

@ecpplus
Created March 3, 2016 02:01
Show Gist options
  • Save ecpplus/1373c676f602326955f8 to your computer and use it in GitHub Desktop.
Save ecpplus/1373c676f602326955f8 to your computer and use it in GitHub Desktop.
[ifconfig API] Exported YAML of Swagger + API Gateway Extention
---
swagger: "2.0"
info:
version: "2016-03-01T14:43:03Z"
title: "ifconfig"
host: "IFCONFIGEXAMPLE.execute-api.ap-northeast-1.amazonaws.com"
basePath: "/prod"
schemes:
- "https"
paths:
/:
get:
produces:
- "application/json"
parameters: []
responses:
200:
description: "200 response"
schema:
$ref: "#/definitions/Empty"
headers: {}
x-amazon-apigateway-integration:
responses:
default:
statusCode: "200"
responseTemplates:
application/json: "#set($ipAddresses = $input.params().header.get('X-Forwarded-For').split(','))\n\
$ipAddresses[0]\n#set($dummy = \"dummy\")"
requestTemplates:
application/json: "{\"statusCode\" : 200}"
type: "mock"
definitions:
Empty:
type: "object"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment