-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathopenapi3.yaml
89 lines (89 loc) · 2.53 KB
/
openapi3.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
openapi: "3.0.1"
info:
title: "ESOURCE Sample Response API #2 (Authorized)"
version: "0.1"
paths:
/users:
get:
responses:
200:
description: "200 response"
content:
application/json:
schema:
$ref: "#/components/schemas/ArrayOfUser"
security:
- CustomAuthorizer: []
x-amazon-apigateway-integration:
uri:
Fn::Sub: arn:aws:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${GetUsersFunction.Arn}/invocations
passthroughBehavior: "when_no_match"
httpMethod: "POST"
type: "aws_proxy"
post:
consumes:
- "application/json"
responses:
201:
description: "User created"
content:
application/json:
schema:
$ref: "#/components/schemas/User"
security:
- CustomAuthorizer: []
x-amazon-apigateway-integration:
uri:
Fn::Sub: arn:aws:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${CreateUserFunction.Arn}/invocations
passthroughBehavior: "when_no_match"
httpMethod: "POST"
type: "aws_proxy"
/users/{id}:
get:
parameters:
- name: "id"
in: "path"
required: true
schema:
type: "string"
responses:
200:
description: "200 response"
content: {}
security:
- CustomAuthorizer: []
x-amazon-apigateway-integration:
uri:
Fn::Sub: arn:aws:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${GetUserFunction.Arn}/invocations
passthroughBehavior: "when_no_match"
httpMethod: "POST"
type: "aws_proxy"
components:
schemas:
User:
type: "object"
properties:
name:
type: "string"
description: "Name of the user"
id:
type: "number"
description: "ID of the user"
description: "A generic user"
ArrayOfUser:
type: "array"
items:
$ref: "#/components/schemas/User"
securitySchemes:
CustomAuthorizer:
type: "apiKey"
name: "Authorization"
in: "header"
x-amazon-apigateway-authtype: "custom"
x-amazon-apigateway-authorizer:
authorizerUri:
Fn::Sub: arn:aws:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${CustomAuthorizerFunction.Arn}/invocations
authorizerCredentials:
Fn::Sub: ${ApiGatewayAuthorizerRole.Arn}
authorizerResultTtlInSeconds: 60
type: "token"