You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+6-4Lines changed: 6 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,7 +14,7 @@
14
14
15
15
16
16
17
-
This will generate an OpenAPI V3 (up to v3.0.3) file for you from your serverless file. It can optionally generate a [Postman Collection V2](https://github.com/postmanlabs/openapi-to-postman) from the OpenAPI file for you too.
17
+
This will generate an OpenAPI V3 (up to v3.0.3) file for you from your serverless file. It can optionally generate a [Postman Collection V2](https://github.com/postmanlabs/openapi-to-postman) from the OpenAPI file for you too. This currently works for `http` and `httpApi` configurations.
18
18
19
19
Originally based off of: https://github.com/temando/serverless-openapi-documentation
20
20
@@ -131,7 +131,7 @@ Options:
131
131
132
132
### Configuration
133
133
134
-
To configure this plugin to generate valid OpenAPI documentation there are two places you'll need to modify in your `serverless.yml` file, the `custom` variables section and the `http` event section for each given function in your service.
134
+
To configure this plugin to generate valid OpenAPI documentation there are two places you'll need to modify in your `serverless.yml` file, the `custom` variables section and the `http/httpApi` event section for each given function in your service.
135
135
136
136
The `custom` section of your `serverless.yml` can be configured as below:
137
137
@@ -164,7 +164,7 @@ custom:
164
164
models: {}
165
165
```
166
166
167
-
Mostly everything here is optional. A version from a UUID will be generated for you if you don't specify one, title will be the name of your service if you don't specify one.
167
+
Mostly everything here is optional. A version from a UUID will be generated for you if you don't specify one, title will be the name of your service if you don't specify one. You will need to specify the `documentation` top object.
168
168
169
169
#### termsOfService
170
170
@@ -483,7 +483,7 @@ functions:
483
483
484
484
#### Functions
485
485
486
-
To define the documentation for a given function event, you need to create a `documentation` attribute for your http event in your `serverless.yml` file.
486
+
To define the documentation for a given function event, you need to create a `documentation` attribute for your `http` or `httpApi` event in your `serverless.yml` file.
487
487
488
488
The `documentation` section of the event configuration can contain the following attributes:
489
489
@@ -506,6 +506,8 @@ The `documentation` section of the event configuration can contain the following
506
506
* `responseHeaders`: a list of response headers (see [responseHeaders](#responseheaders) below)
507
507
* `responseModels`: a list of models to describe the request bodies (see [responseModels](#responsemodels) below) for each `Content-Type`
508
508
509
+
If you don't want a `http` or `httpApi` event to be documented, you can leave off the `documentation` object. The configuration schema will only check that you have specified a `methodResponses` on the `documentation` event, previously the plugin would cause serverless to warn or error (depending on your `configValidationMode`) if you had not supplied a `documentation` on an event.
0 commit comments