Skip to content
This repository was archived by the owner on Dec 10, 2021. It is now read-only.

Commit d065400

Browse files
authored
Merge pull request #21 from conqa/update-readme
Update readme and changelog
2 parents 8eb0781 + 60087b6 commit d065400

File tree

2 files changed

+58
-19
lines changed

2 files changed

+58
-19
lines changed

CHANGELOG.md

+34-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,40 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
66
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
77

8+
## [Unreleased]
9+
### Added
10+
- Support for securitySchemes and security #15
11+
- Support for servers #18
12+
- Support for schemas included by path with all $refs merged into components #7
13+
### Changed
14+
- Convert project from Yarn to npm #5
15+
- Switch to eslint #8
16+
- Update Readme #19
17+
18+
## [1.0.4] - 2019-05-07
19+
### Fixed
20+
- Fix issue with last release where the package was published from the root directory, not the build directory
21+
22+
## [1.0.3] - 2019-05-07
23+
### Fixed
24+
- Fix for requestBody and parameters #6
25+
26+
## [1.0.2] - 2019-05-03
27+
### Changed
28+
- test tag publish
29+
30+
## [1.0.1] - 2019-05-02
31+
### Changed
32+
- test tag publish
33+
34+
## [1.0.0] - 2019-05-02
35+
### Changed
36+
- inital release after forking from temando/serverless-openapi-documentation
37+
838

939
[Unreleased]: https://github.com/conqa/serverless-openapi-documentation/compare/v1.0.4...HEAD
1040
[1.0.4]: https://github.com/conqa/serverless-openapi-documentation/compare/v1.0.3...v1.0.4
11-
[1.0.3]: https://github.com/conqa/serverless-openapi-documentation/tree/v1.0.3
41+
[1.0.3]: https://github.com/conqa/serverless-openapi-documentation/compare/v1.0.2...v1.0.3
42+
[1.0.2]: https://github.com/conqa/serverless-openapi-documentation/compare/v1.0.1...v1.0.2
43+
[1.0.1]: https://github.com/conqa/serverless-openapi-documentation/compare/v1.0.0...v1.0.1
44+
[1.0.0]: https://github.com/conqa/serverless-openapi-documentation/tree/v1.0.0

README.md

+24-18
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
# Serverless OpenAPI Documentation Plugin
22

3-
[![NPM](https://img.shields.io/npm/v/serverless-openapi-documentation.svg)](https://npmjs.org/packages/serverless-openapi-documentation/)
4-
[![Travis CI](https://img.shields.io/travis/temando/serverless-openapi-documentation.svg)](https://travis-ci.org/temando/serverless-openapi-documentation)
5-
[![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)
3+
[![NPM](https://img.shields.io/npm/v/@conqa/serverless-openapi-documentation.svg)](https://npmjs.org/packages/@conqa/serverless-openapi-documentation/)
4+
[![Travis CI](https://img.shields.io/travis/conqa/serverless-openapi-documentation.svg)](https://travis-ci.org/conqa/serverless-openapi-documentation)
65

76
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).
87

9-
Works well with [Lincoln OpenAPI Renderer](https://github.com/temando/open-api-renderer).
8+
Works well with [ReDoc](https://github.com/Rebilly/ReDoc).
109

1110
---
1211

@@ -20,7 +19,7 @@ Works well with [Lincoln OpenAPI Renderer](https://github.com/temando/open-api-r
2019
- [`cookieParams`](#cookieparams)
2120
- [`requestModels`](#requestmodels)
2221
- [`methodResponses`](#methodresponses)
23-
- [Example Configuration](#example-configuration)
22+
- [Example configuration](#example-configuration)
2423
- [Install](#install)
2524

2625
---
@@ -60,6 +59,10 @@ custom:
6059
version: '1'
6160
title: 'My API'
6261
description: 'This is my API'
62+
# https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#securitySchemeObject
63+
securitySchemes: {}
64+
# https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#security-requirement-object
65+
security: {}
6366
models: {}
6467
```
6568
@@ -89,22 +92,17 @@ The *required* directives for the models section are as follow:
8992
* `name`: the name of the schema
9093
* `description`: a description of the schema
9194
* `contentType`: the content type of the described request/response (ie. `application/json` or `application/xml`).
92-
* `schema`: The JSON Schema ([website](http://json-schema.org/)) that describes the model. You can either use inline `YAML` to define these, or refer to an external schema file as below
95+
* `schema`: The JSON Schema ([website](http://json-schema.org/)) that describes the model. You can either:
96+
- use inline `YAML` to define these
97+
- use serverless' functionality to merge in external schema file
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
9399

94100
```yml
95101
custom:
96102
documentation:
97103
models:
98-
- name: "ErrorResponse"
99-
description: "This is an error"
100-
contentType: "application/json"
101-
schema: ${file(models/ErrorResponse.json)}
102-
- name: "PutDocumentResponse"
103-
description: "PUT Document response model (external reference example)"
104-
contentType: "application/json"
105-
schema: ${file(models/PutDocumentResponse.json)}
106104
- name: "PutDocumentRequest"
107-
description: "PUT Document request model (inline example)"
105+
description: "Inline schema example"
108106
contentType: "application/json"
109107
schema:
110108
$schema: "http://json-schema.org/draft-04/schema#"
@@ -114,6 +112,14 @@ custom:
114112
properties:
115113
SomeAttribute:
116114
type: "string"
115+
- name: "PutDocumentResponse"
116+
description: "External file merge example"
117+
contentType: "application/json"
118+
schema: ${file(models/PutDocumentResponse.json)}
119+
- name: "ErrorResponse"
120+
description: "Path to a schema example"
121+
contentType: "application/json"
122+
schema: models/ErrorResponse.json
117123
```
118124

119125
#### Functions
@@ -312,19 +318,19 @@ To add this plugin to your package.json:
312318

313319
**Using npm:**
314320
```bash
315-
npm install serverless-openapi-documentation --save-dev
321+
npm install @conqa/serverless-openapi-documentation --save-dev
316322
```
317323

318324
**Using Yarn:**
319325
```bash
320-
yarn add serverless-openapi-documentation --dev
326+
yarn add @conqa/serverless-openapi-documentation --dev
321327
```
322328

323329
Next you need to add the plugin to the `plugins` section of your `serverless.yml` file.
324330

325331
```yml
326332
plugins:
327-
- serverless-openapi-documentation
333+
- @conqa/serverless-openapi-documentation
328334
```
329335

330336
You can confirm the plugin is correctly installed by running:

0 commit comments

Comments
 (0)