forked from martinsson/serverless-openapi-documentation
-
Notifications
You must be signed in to change notification settings - Fork 0
/
serverless.yml
58 lines (55 loc) · 1.74 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
service: serverless-openapi-doc-demo
frameworkVersion: ">=1.1.0 < 2.0.0"
provider:
name: aws
runtime: nodejs6.10
plugins:
localPath: ../../
modules:
- build
functions:
createUser:
handler: handler.create
events:
- http:
path: create/{username}
method: post
documentation:
summary: Create User
description: Creates a user and then sends a generated password email
requestBody:
description: A user information object
requestModels:
application/json: PutDocumentRequest
pathParams:
- name: username
description: The username for a user to create
schema:
type: string
pattern: "^[-a-z0-9_]+$"
queryParams:
- name: membershipType
description: The user's Membership Type
schema:
type: string
enum:
- premium
- standard
cookieParams:
- name: SessionId
description: A Session ID variable
schema:
type: string
methodResponses:
- statusCode: 201
responseBody:
description: A user object along with generated API Keys
responseModels:
application/json: PutDocumentResponse
- statusCode: 500
responseBody:
description: An error message when creating a new user
responseModels:
application/json: ErrorResponse
custom:
documentation: ${file(serverless.doc.yml):documentation}