-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathswagger.yml
120 lines (117 loc) · 3.18 KB
/
swagger.yml
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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
openapi: 3.0.0
info:
title: oserverless-swagger-demo
version: 0.3.0
description: "This is an example OpenAPI specification"
termsOfService: "http://example.com/tos"
contact:
email: "[email protected]"
x-amazon-apigateway-request-validators:
all:
validateRequestBody: true
validateRequestParameters: true
params:
validateRequestBody: true
validateRequestParameters: true
body:
validateRequestBody: true
validateRequestParameters: false
paths:
/docs:
get:
operationId: docs
x-amazon-apigateway-integration:
credentials:
Fn::Sub: ${ApiRole.Arn}
httpMethod: POST
uri:
Fn::Sub: arn:aws:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${DocsFunction.Arn}/invocations
timeoutInMillis: 3000
type: "aws_proxy"
responses:
'200':
description: A 200 response.
content:
application/json:
schema:
type: object
/{proxy+}:
x-amazon-apigateway-any-method:
operationId: docs
produces:
- "application/json"
x-amazon-apigateway-integration:
credentials:
Fn::Sub: ${ApiRole.Arn}
httpMethod: POST
uri:
Fn::Sub: arn:aws:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${DocsFunction.Arn}/invocations
timeoutInMillis: 3000
type: "aws_proxy"
/testFunc:
get:
operationId: testFunc
description: Test sam local functionality with API Gateway & Open API
x-amazon-apigateway-request-validator: params
parameters:
- in: query
name: testQuery
description: a test parameter to see how parameters are passed via swagger & API Gateway.
required: true
schema:
type: string
x-amazon-apigateway-integration:
credentials:
Fn::Sub: ${ApiRole.Arn}
uri:
Fn::Sub: arn:aws:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${TestFunction.Arn}/invocations
httpMethod: POST
timeoutInMillis: 3000
type: "aws_proxy"
responses:
'200':
description: A 200 response.
content:
application/json:
schema:
type: object
'400':
description: bad input parameter
components:
schemas:
Item:
type: object
required:
- id
- name
- manufacturer
- releaseDate
properties:
id:
type: string
format: uuid
example: d290f1ee-6c54-4b01-90e6-d701748f0851
name:
type: string
example: Widget Adapter
releaseDate:
type: string
format: date-time
example: '2016-08-29T09:12:33.001Z'
manufacturer:
$ref: '#/components/schemas/Manufacturer'
Manufacturer:
required:
- name
properties:
name:
type: string
example: ACME Corporation
homePage:
type: string
format: url
example: 'https://www.acme-corp.com'
phone:
type: string
example: 408-867-5309
type: object