serverless-openapi-documenter 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,14 @@
1
+ {
2
+ "name": "serverless-2",
3
+ "version": "1.0.0",
4
+ "description": "",
5
+ "main": "index.js",
6
+ "scripts": {
7
+ "test": "echo \"Error: no test specified\" && exit 1"
8
+ },
9
+ "author": "",
10
+ "license": "ISC",
11
+ "devDependencies": {
12
+ "serverless": "^2.72.3"
13
+ }
14
+ }
@@ -0,0 +1,62 @@
1
+ endpoints:
2
+ createUser:
3
+ summary: Create User
4
+ description: Creates a user and then sends a generated password email
5
+ requestBody:
6
+ description: A user information object
7
+ requestModels:
8
+ application/json: PutDocumentRequest
9
+ pathParams:
10
+ - name: username
11
+ description: The username for a user to create
12
+ schema:
13
+ type: string
14
+ pattern: "^[-a-z0-9_]+$"
15
+ queryParams:
16
+ - name: membershipType
17
+ description: The user's Membership Type
18
+ schema:
19
+ type: string
20
+ enum:
21
+ - premium
22
+ - standard
23
+ cookieParams:
24
+ - name: SessionId
25
+ description: A Session ID variable
26
+ schema:
27
+ type: string
28
+ methodResponses:
29
+ - statusCode: 201
30
+ responseBody:
31
+ description: A user object along with generated API Keys
32
+ responseModels:
33
+ application/json: PutDocumentResponse
34
+ - statusCode: 500
35
+ responseBody:
36
+ description: An error message when creating a new user
37
+ responseModels:
38
+ application/json: ErrorResponse
39
+
40
+ documentation:
41
+ models:
42
+ - name: ErrorResponse
43
+ description: This is an error
44
+ contentType: application/json
45
+ schema: ${file(models/ErrorResponse.json)}
46
+
47
+ - name: PutDocumentResponse
48
+ description: PUT Document response model (external reference example)
49
+ contentType: application/json
50
+ schema: ${file(models/PutDocumentResponse.json)}
51
+
52
+ - name: PutDocumentRequest
53
+ description: PUT Document request model (inline example)
54
+ contentType: application/json
55
+ schema:
56
+ $schema: http://json-schema.org/draft-04/schema#
57
+ properties:
58
+ SomeObject:
59
+ type: object
60
+ properties:
61
+ SomeAttribute:
62
+ type: string
@@ -0,0 +1,91 @@
1
+ service: serverless-openapi-doc-demo
2
+ frameworkVersion: ">=2.0.0 < 3.0.0"
3
+ provider:
4
+ name: aws
5
+ runtime: nodejs14.x
6
+
7
+ plugins:
8
+ - ../../index.js
9
+
10
+ functions:
11
+ createUser:
12
+ handler: handler.create
13
+ description: blah blah
14
+ summary: a function
15
+ events:
16
+ - http:
17
+ path: create/{username}
18
+ method: post
19
+ documentation:
20
+ summary: Create User
21
+ description: Creates a user and then sends a generated password email
22
+ requestBody:
23
+ description: A user information object
24
+ requestModels:
25
+ application/json: PutDocumentRequest
26
+ pathParams:
27
+ - name: username
28
+ description: The username for a user to create
29
+ schema:
30
+ type: string
31
+ pattern: "^[-a-z0-9_]+$"
32
+ queryParams:
33
+ - name: membershipType
34
+ description: The user's Membership Type
35
+ schema:
36
+ type: string
37
+ enum:
38
+ - premium
39
+ - standard
40
+ cookieParams:
41
+ - name: SessionId
42
+ description: A Session ID variable
43
+ schema:
44
+ type: string
45
+ methodResponses:
46
+ - statusCode: 201
47
+ responseBody:
48
+ description: A user object along with generated API Keys
49
+ responseModels:
50
+ application/json: PutDocumentResponse
51
+ - statusCode: 500
52
+ responseBody:
53
+ description: An error message when creating a new user
54
+ responseModels:
55
+ application/json: ErrorResponse
56
+ deleteUser:
57
+ handler: handler.delete
58
+ events:
59
+ - http:
60
+ path: delete
61
+ method: delete
62
+
63
+ custom:
64
+ documentation:
65
+ description: This is a description of what this does
66
+ version: 1.0.0
67
+ models:
68
+ - name: ErrorResponse
69
+ description: This is an error
70
+ content:
71
+ application/json:
72
+ schema: ${file(../models/ErrorResponse.json)}
73
+
74
+ - name: PutDocumentResponse
75
+ description: PUT Document response model (external reference example)
76
+ content:
77
+ application/json:
78
+ schema: ${file(../models/PutDocumentResponse.json)}
79
+
80
+ - name: PutDocumentRequest
81
+ description: PUT Document request model (inline example)
82
+ content:
83
+ application/json:
84
+ schema:
85
+ $schema: http://json-schema.org/draft-04/schema#
86
+ properties:
87
+ SomeObject:
88
+ type: object
89
+ properties:
90
+ SomeAttribute:
91
+ type: string
@@ -0,0 +1,62 @@
1
+ endpoints:
2
+ createUser:
3
+ summary: Create User
4
+ description: Creates a user and then sends a generated password email
5
+ requestBody:
6
+ description: A user information object
7
+ requestModels:
8
+ application/json: PutDocumentRequest
9
+ pathParams:
10
+ - name: username
11
+ description: The username for a user to create
12
+ schema:
13
+ type: string
14
+ pattern: "^[-a-z0-9_]+$"
15
+ queryParams:
16
+ - name: membershipType
17
+ description: The user's Membership Type
18
+ schema:
19
+ type: string
20
+ enum:
21
+ - premium
22
+ - standard
23
+ cookieParams:
24
+ - name: SessionId
25
+ description: A Session ID variable
26
+ schema:
27
+ type: string
28
+ methodResponses:
29
+ - statusCode: 201
30
+ responseBody:
31
+ description: A user object along with generated API Keys
32
+ responseModels:
33
+ application/json: PutDocumentResponse
34
+ - statusCode: 500
35
+ responseBody:
36
+ description: An error message when creating a new user
37
+ responseModels:
38
+ application/json: ErrorResponse
39
+
40
+ documentation:
41
+ models:
42
+ - name: ErrorResponse
43
+ description: This is an error
44
+ contentType: application/json
45
+ schema: ${file(models/ErrorResponse.json)}
46
+
47
+ - name: PutDocumentResponse
48
+ description: PUT Document response model (external reference example)
49
+ contentType: application/json
50
+ schema: ${file(models/PutDocumentResponse.json)}
51
+
52
+ - name: PutDocumentRequest
53
+ description: PUT Document request model (inline example)
54
+ contentType: application/json
55
+ schema:
56
+ $schema: http://json-schema.org/draft-04/schema#
57
+ properties:
58
+ SomeObject:
59
+ type: object
60
+ properties:
61
+ SomeAttribute:
62
+ type: string
@@ -0,0 +1,78 @@
1
+ service: serverless-openapi-doc-demo
2
+ frameworkVersion: ">=3.0.0 < 4.0.0"
3
+ provider:
4
+ name: aws
5
+ runtime: nodejs14.x
6
+
7
+ plugins:
8
+ - ../../index.js
9
+
10
+ functions:
11
+ createUser:
12
+ handler: handler.create
13
+ events:
14
+ - http:
15
+ path: create
16
+ method: post
17
+ documentation:
18
+ summary: Create User
19
+ description: Creates a user and then sends a generated password email
20
+ requestBody:
21
+ description: A user information object
22
+ requestModels:
23
+ application/json: PutDocumentRequest
24
+ pathParams:
25
+ - name: username
26
+ description: The username for a user to create
27
+ schema:
28
+ type: string
29
+ pattern: "^[-a-z0-9_]+$"
30
+ queryParams:
31
+ - name: membershipType
32
+ description: The user's Membership Type
33
+ schema:
34
+ type: string
35
+ enum:
36
+ - premium
37
+ - standard
38
+ cookieParams:
39
+ - name: SessionId
40
+ description: A Session ID variable
41
+ schema:
42
+ type: string
43
+ methodResponses:
44
+ - statusCode: 201
45
+ responseBody:
46
+ description: A user object along with generated API Keys
47
+ responseModels:
48
+ application/json: PutDocumentResponse
49
+ - statusCode: 500
50
+ responseBody:
51
+ description: An error message when creating a new user
52
+ responseModels:
53
+ application/json: ErrorResponse
54
+
55
+ custom:
56
+ documentation:
57
+ models:
58
+ - name: ErrorResponse
59
+ description: This is an error
60
+ contentType: application/json
61
+ schema: ${file(models/ErrorResponse.json)}
62
+
63
+ - name: PutDocumentResponse
64
+ description: PUT Document response model (external reference example)
65
+ contentType: application/json
66
+ schema: ${file(models/PutDocumentResponse.json)}
67
+
68
+ - name: PutDocumentRequest
69
+ description: PUT Document request model (inline example)
70
+ contentType: application/json
71
+ schema:
72
+ $schema: http://json-schema.org/draft-04/schema#
73
+ properties:
74
+ SomeObject:
75
+ type: object
76
+ properties:
77
+ SomeAttribute:
78
+ type: string