-
Notifications
You must be signed in to change notification settings - Fork 1
/
serverless.yml
84 lines (78 loc) · 2.07 KB
/
serverless.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
service: swagger-lambda
provider:
name: aws
stage: ${opt:stage, 'dev'}
runtime: java8
region: eu-west-1
memorySize: 1024
timeout: 300
environment:
environment: ${self:provider.stage}
package:
artifact: target/swagger-lambda-1.0.0.jar
functions:
getPet:
handler: com.mfalcier.PetGetHandler
events:
- http:
path: pets/{id}
method: get
documentation:
summary: "Get a pet"
description: "Get a pet by giving its ID"
pathParams:
-
name: "id"
description: "Pet Id"
required: "true"
methodResponses:
-
statusCode: "200"
responseBody:
description: "Response body description"
responseModels:
"application/json": "SimpleResponse"
-
statusCode: "502"
responseBody:
description: "Response body error description"
responseModel:
"application/json": "AwsError"
plugins:
- serverless-aws-documentation
custom:
documentation:
info:
version: "2"
title: "Swagger Lambda"
description: "This API is used for test purposes, Swagger related"
contact:
name: "Example Company"
email: "info@email.com"
resources:
-
path: "pets/{id}"
description: "This is the description for pets/{id}"
models:
-
name: "AwsError"
description: "an aws internal server error, usually with status code 502 (bad gateway)"
contentType: "application/json"
schema:
type: object
properties:
message:
type: string
required:
- message
-
name: "SimpleResponse"
description: "a simple response message"
contentType: "application/json"
schema:
type: object
properties:
message:
type: string
required:
- message