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
Generates [**OpenAPI 3.0.0**](https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/3.0.0.md) documentation from serverless configuration files. OpenAPI is formerly known as Swagger. The configuration is inspired by the format used in [serverless-aws-documentation](https://www.npmjs.com/package/serverless-aws-documentation).
6
+
Generates [**OpenAPI 3.0.0**](https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/3.0.0.md) documentation from serverless configuration files. OpenAPI is formerly known as Swagger. The configuration is inspired by the format used in [serverless-aws-documentation](https://www.npmjs.com/package/serverless-aws-documentation). This plugin takes over [serverless-openapi-documentation](https://www.npmjs.com/package/serverless-openapi-documentation), which was no longer maintained. It aims to provide improvements, and especially adds support for API Gateway's [HTTP Apis](https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api.html).
7
7
8
8
Works well with [ReDoc](https://github.com/Rebilly/ReDoc).
9
9
@@ -56,9 +56,9 @@ The `custom` section of your `serverless.yml` can be configured as below:
@@ -85,14 +85,14 @@ For more info on `serverless.yml` syntax, see their docs.
85
85
86
86
#### Models
87
87
88
-
Models contain additional information that you can use to define schemas for endpoints. You must define the *content type* for each schema that you provide in the models.
88
+
Models contain additional information that you can use to define schemas for endpoints. You must define the _content type_ for each schema that you provide in the models.
89
89
90
-
The *required* directives for the models section are as follow:
90
+
The _required_ directives for the models section are as follow:
91
91
92
-
* `name`: the name of the schema
93
-
* `description`: a description of the schema
94
-
* `contentType`: the content type of the described request/response (ie. `application/json` or `application/xml`).
95
-
* `schema`: The JSON Schema ([website](http://json-schema.org/)) that describes the model. You can either:
92
+
-`name`: the name of the schema
93
+
-`description`: a description of the schema
94
+
-`contentType`: the content type of the described request/response (ie. `application/json` or `application/xml`).
95
+
-`schema`: The JSON Schema ([website](http://json-schema.org/)) that describes the model. You can either:
96
96
- use inline `YAML` to define these
97
97
- use serverless' functionality to merge in external schema file
98
98
- specify a path to json schema in which case if you reuse some types in multiple schemas - they will be included in resulting components once instead of duplicated for each referencing schema
@@ -128,22 +128,22 @@ To define the documentation for a given function event, you need to create a `do
128
128
129
129
The `documentation` section of the event configuration can contain the following attributes:
130
130
131
-
* `summary`: a short description of the method
132
-
* `description`: a detailed description of the method
133
-
* `tags`: an array of tags for this event
134
-
* `deprecated`: boolean indicator that indicates clients should migrate away from this function
135
-
* `requestBody`: contains description of the request
136
-
* `description`: a description of the request body
137
-
* `requestModels`: a list of models to describe the request bodies (see [requestModels](#requestmodels) below)
138
-
* `queryParams`: a list of query parameters (see [queryParams](#queryparams) below)
139
-
* `pathParams`: a list of path parameters (see [pathParams](#pathparams) below)
140
-
* `cookieParams`: a list of cookie parameters (see [cookieParams](#cookieparams) below)
141
-
* `methodResponses`: an array of response models and applicable status codes
142
-
* `statusCode`: applicable http status code (ie. 200/404/500 etc.)
143
-
* `responseBody`: contains description of the response
144
-
* `description`: a description of the body response
145
-
* `responseHeaders`: a list of response headers (see [responseHeaders](#responseheaders) below)
146
-
* `responseModels`: a list of models to describe the request bodies (see [responseModels](#responsemodels) below) for each `Content-Type`
131
+
-`summary`: a short description of the method
132
+
-`description`: a detailed description of the method
133
+
-`tags`: an array of tags for this event
134
+
-`deprecated`: boolean indicator that indicates clients should migrate away from this function
135
+
-`requestBody`: contains description of the request
136
+
-`description`: a description of the request body
137
+
-`requestModels`: a list of models to describe the request bodies (see [requestModels](#requestmodels) below)
138
+
-`queryParams`: a list of query parameters (see [queryParams](#queryparams) below)
139
+
-`pathParams`: a list of path parameters (see [pathParams](#pathparams) below)
140
+
-`cookieParams`: a list of cookie parameters (see [cookieParams](#cookieparams) below)
141
+
-`methodResponses`: an array of response models and applicable status codes
142
+
-`statusCode`: applicable http status code (ie. 200/404/500 etc.)
143
+
-`responseBody`: contains description of the response
144
+
-`description`: a description of the body response
145
+
-`responseHeaders`: a list of response headers (see [responseHeaders](#responseheaders) below)
146
+
-`responseModels`: a list of models to describe the request bodies (see [responseModels](#responsemodels) below) for each `Content-Type`
147
147
148
148
```yml
149
149
functions:
@@ -196,10 +196,10 @@ functions:
196
196
197
197
Query parameters can be described as follow:
198
198
199
-
* `name`: the name of the query variable
200
-
* `description`: a description of the query variable
201
-
* `required`: whether the query parameter is mandatory (boolean)
202
-
* `schema`: JSON schema (inline or file)
199
+
-`name`: the name of the query variable
200
+
-`description`: a description of the query variable
201
+
-`required`: whether the query parameter is mandatory (boolean)
202
+
-`schema`: JSON schema (inline or file)
203
203
204
204
```yml
205
205
queryParams:
@@ -214,9 +214,9 @@ queryParams:
214
214
215
215
Path parameters can be described as follow:
216
216
217
-
* `name`: the name of the query variable
218
-
* `description`: a description of the query variable
219
-
* `schema`: JSON schema (inline or file)
217
+
-`name`: the name of the query variable
218
+
-`description`: a description of the query variable
219
+
-`schema`: JSON schema (inline or file)
220
220
221
221
```yml
222
222
pathParams:
@@ -230,10 +230,10 @@ pathParams:
230
230
231
231
Cookie parameters can be described as follow:
232
232
233
-
* `name`: the name of the query variable
234
-
* `description`: a description of the query variable
235
-
* `required`: whether the query parameter is mandatory (boolean)
236
-
* `schema`: JSON schema (inline or file)
233
+
-`name`: the name of the query variable
234
+
-`description`: a description of the query variable
235
+
-`required`: whether the query parameter is mandatory (boolean)
236
+
-`schema`: JSON schema (inline or file)
237
237
238
238
```yml
239
239
cookieParams:
@@ -289,9 +289,9 @@ The `responseHeaders/requestHeaders` section of the configuration allows you to
289
289
290
290
The attributes for a header are as follow:
291
291
292
-
* `name`: the name of the HTTP Header
293
-
* `description`: a description of the HTTP Header
294
-
* `schema`: JSON schema (inline or file)
292
+
-`name`: the name of the HTTP Header
293
+
-`description`: a description of the HTTP Header
294
+
-`schema`: JSON schema (inline or file)
295
295
296
296
```yml
297
297
responseHeaders:
@@ -317,11 +317,13 @@ This plugin works for Serverless 1.x and up. Serverless 0.5 is not supported.
0 commit comments