Skip to content

Commit 4d94a63

Browse files
authored
Add httpbin.julialang.org AWS API Gateway config
This serves as a backup of the AWS API Gateway configuration hosted at `httpbin.julialang.org`
1 parent 96fc2aa commit 4d94a63

File tree

1 file changed

+101
-0
lines changed

1 file changed

+101
-0
lines changed
Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
---
2+
swagger: "2.0"
3+
info:
4+
description: "Looks like an httpbin"
5+
version: "2020-06-18T07:18:54Z"
6+
title: "httpbin"
7+
host: "httpbin.julialang.org"
8+
schemes:
9+
- "https"
10+
paths:
11+
/get:
12+
get:
13+
consumes:
14+
- "application/json"
15+
produces:
16+
- "application/json"
17+
responses:
18+
200:
19+
description: "200 response"
20+
schema:
21+
$ref: "#/definitions/Empty"
22+
x-amazon-apigateway-integration:
23+
responses:
24+
default:
25+
statusCode: "200"
26+
responseTemplates:
27+
application/json: "#set($allParams = $input.params())\n{\n\"args\":\
28+
\ {\n#set($params = $allParams.get(\"querystring\"))\n#foreach($paramName\
29+
\ in $params.keySet())\n\"$paramName\" : \"$util.escapeJavaScript($params.get($paramName)).replaceAll(\"\
30+
\\\\'\",\"'\")\"\n#if($foreach.hasNext),#end\n\n#end\n},\n\"headers\"\
31+
: {\n#set($params = $allParams.get(\"header\"))\n#foreach($paramName\
32+
\ in $params.keySet())\n\"$paramName\" : \"$util.escapeJavaScript($params.get($paramName)).replaceAll(\"\
33+
\\\\'\",\"'\")\"#if($foreach.hasNext),#end\n\n#end\n},\n\"origin\"\
34+
: \"$context.identity.sourceIp\",\n\"url\": \"$context.path\"\n}\n"
35+
requestTemplates:
36+
application/json: "{\"statusCode\": 200}"
37+
passthroughBehavior: "when_no_match"
38+
type: "mock"
39+
/ip:
40+
get:
41+
consumes:
42+
- "application/json"
43+
produces:
44+
- "application/json"
45+
responses:
46+
200:
47+
description: "200 response"
48+
x-amazon-apigateway-integration:
49+
responses:
50+
default:
51+
statusCode: "200"
52+
responseTemplates:
53+
application/json: "{\n \"origin\" : \"$context.identity.sourceIp\"\n\
54+
}"
55+
requestTemplates:
56+
application/json: "{\"statusCode\": 200}"
57+
passthroughBehavior: "when_no_match"
58+
type: "mock"
59+
/status/200:
60+
get:
61+
consumes:
62+
- "application/json"
63+
produces:
64+
- "application/json"
65+
responses:
66+
200:
67+
description: "200 response"
68+
schema:
69+
$ref: "#/definitions/Empty"
70+
x-amazon-apigateway-integration:
71+
responses:
72+
default:
73+
statusCode: "200"
74+
requestTemplates:
75+
application/json: "{\"statusCode\": 200}"
76+
passthroughBehavior: "when_no_match"
77+
type: "mock"
78+
/status/404:
79+
get:
80+
consumes:
81+
- "application/json"
82+
responses:
83+
404:
84+
description: "404 response"
85+
x-amazon-apigateway-integration:
86+
responses:
87+
default:
88+
statusCode: "404"
89+
requestTemplates:
90+
application/json: "{\"statusCode\": 404}"
91+
passthroughBehavior: "when_no_match"
92+
type: "mock"
93+
definitions:
94+
Empty:
95+
type: "object"
96+
title: "Empty Schema"
97+
x-amazon-apigateway-gateway-responses:
98+
DEFAULT_4XX:
99+
statusCode: 401
100+
responseTemplates:
101+
application/json: "{\"message\":$context.error.messageString}"

0 commit comments

Comments
 (0)