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
{{ message }}
This repository was archived by the owner on Dec 10, 2021. It is now read-only.
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).
8
7
9
-
Works well with [Lincoln OpenAPI Renderer](https://github.com/temando/open-api-renderer).
8
+
Works well with [ReDoc](https://github.com/Rebilly/ReDoc).
10
9
11
10
---
12
11
@@ -20,7 +19,7 @@ Works well with [Lincoln OpenAPI Renderer](https://github.com/temando/open-api-r
@@ -89,22 +92,17 @@ The *required* directives for the models section are as follow:
89
92
* `name`: the name of the schema
90
93
* `description`: a description of the schema
91
94
* `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
93
99
94
100
```yml
95
101
custom:
96
102
documentation:
97
103
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)}
106
104
- name: "PutDocumentRequest"
107
-
description: "PUT Document request model (inline example)"
0 commit comments