Skip to content

Commit cca167e

Browse files
author
alexandrepernin
committed
feat: update readme to quote original plugin
1 parent e49b792 commit cca167e

File tree

1 file changed

+42
-40
lines changed

1 file changed

+42
-40
lines changed

Diff for: README.md

+42-40
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
[![NPM](https://img.shields.io/npm/v/@conqa/serverless-openapi-documentation.svg)](https://npmjs.org/packages/@conqa/serverless-openapi-documentation/)
44
[![Travis CI](https://img.shields.io/travis/conqa/serverless-openapi-documentation.svg)](https://travis-ci.org/conqa/serverless-openapi-documentation)
55

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).
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).
77

88
Works well with [ReDoc](https://github.com/Rebilly/ReDoc).
99

@@ -56,9 +56,9 @@ The `custom` section of your `serverless.yml` can be configured as below:
5656
```yml
5757
custom:
5858
documentation:
59-
version: '1'
60-
title: 'My API'
61-
description: 'This is my API'
59+
version: "1"
60+
title: "My API"
61+
description: "This is my API"
6262
# https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#securitySchemeObject
6363
securitySchemes: {}
6464
# https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#security-requirement-object
@@ -85,14 +85,14 @@ For more info on `serverless.yml` syntax, see their docs.
8585

8686
#### Models
8787

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.
8989

90-
The *required* directives for the models section are as follow:
90+
The _required_ directives for the models section are as follow:
9191

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:
9696
- use inline `YAML` to define these
9797
- use serverless' functionality to merge in external schema file
9898
- 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
128128

129129
The `documentation` section of the event configuration can contain the following attributes:
130130

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`
147147

148148
```yml
149149
functions:
@@ -196,10 +196,10 @@ functions:
196196

197197
Query parameters can be described as follow:
198198

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)
203203

204204
```yml
205205
queryParams:
@@ -214,9 +214,9 @@ queryParams:
214214

215215
Path parameters can be described as follow:
216216

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)
220220

221221
```yml
222222
pathParams:
@@ -230,10 +230,10 @@ pathParams:
230230

231231
Cookie parameters can be described as follow:
232232

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)
237237

238238
```yml
239239
cookieParams:
@@ -289,9 +289,9 @@ The `responseHeaders/requestHeaders` section of the configuration allows you to
289289

290290
The attributes for a header are as follow:
291291

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)
295295

296296
```yml
297297
responseHeaders:
@@ -317,11 +317,13 @@ This plugin works for Serverless 1.x and up. Serverless 0.5 is not supported.
317317
To add this plugin to your package.json:
318318

319319
**Using npm:**
320+
320321
```bash
321322
npm install serverless-openapi --save-dev
322323
```
323324

324325
**Using Yarn:**
326+
325327
```bash
326328
yarn add serverless-openapi --dev
327329
```

0 commit comments

Comments
 (0)