|
16 | 16 | <!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE --> |
17 | 17 | **Table of Contents** <!-- *generated with [DocToc](https://github.com/thlorenz/doctoc)* --> |
18 | 18 |
|
19 | | -- [Installation](#installation) |
20 | | -- [API](#api) |
21 | | - - [openapi-validator-middleware.validate(fastifyOptions)](#openapi-validator-middlewarevalidatefastifyoptions) |
22 | | - - [fastifyOptions](#fastifyoptions) |
23 | | - - [openapi-validator-middleware.init(pathToSwaggerFile, options)](#openapi-validator-middlewareinitpathtoswaggerfile-options) |
24 | | - - [Options](#options) |
25 | | -- [Usage Example](#usage-example) |
26 | | - - [Express](#express) |
27 | | - - [Koa](#koa) |
28 | | - - [Fastify](#fastify) |
29 | | -- [Important Notes](#important-notes) |
30 | | - - [Schema Objects](#schema-objects) |
31 | | - - [Multipart/form-data (files)](#multipartform-data-files) |
32 | | - - [Fastify support](#fastify-support) |
33 | | - - [Koa support](#koa-support) |
34 | | - - [Koa packages](#koa-packages) |
35 | | -- [Known Issues with OpenAPI 3](#known-issues-with-openapi-3) |
36 | | -- [Running Tests](#running-tests) |
| 19 | +- [openapi-validator-middleware](#openapi-validator-middleware) |
| 20 | + - [Installation](#installation) |
| 21 | + - [API](#api) |
| 22 | + - [openapi-validator-middleware.validate(fastifyOptions)](#openapi-validator-middlewarevalidatefastifyoptions) |
| 23 | + - [fastifyOptions](#fastifyoptions) |
| 24 | + - [openapi-validator-middleware.init(pathToSwaggerFile, options)](#openapi-validator-middlewareinitpathtoswaggerfile-options) |
| 25 | + - [openapi-validator-middleware.initAsync(pathToSwaggerFile, options)](#openapi-validator-middlewareinitasyncpathtoswaggerfile-options) |
| 26 | + - [Options](#options) |
| 27 | + - [Usage Example](#usage-example) |
| 28 | + - [Express](#express) |
| 29 | + - [Koa](#koa) |
| 30 | + - [Fastify](#fastify) |
| 31 | + - [Important Notes](#important-notes) |
| 32 | + - [Schema Objects](#schema-objects) |
| 33 | + - [Multipart/form-data (files)](#multipartform-data-files) |
| 34 | + - [Fastify support](#fastify-support) |
| 35 | + - [Koa support](#koa-support) |
| 36 | + - [Koa packages](#koa-packages) |
| 37 | + - [Known Issues with OpenAPI 3](#known-issues-with-openapi-3) |
| 38 | + - [Running Tests](#running-tests) |
37 | 39 |
|
38 | 40 | <!-- END doctoc generated TOC please keep comment here to allow auto update --> |
39 | 41 |
|
@@ -69,7 +71,17 @@ Initialize the middleware using a swagger definition. |
69 | 71 | The function executes synchronously and does not return anything. |
70 | 72 |
|
71 | 73 | - `pathToSwaggerFile`: Path to the swagger definition. |
72 | | -- `options`: Additional options for the middleware (see below). |
| 74 | +- `options`: Additional options for the middleware ([see below](#options)). |
| 75 | + |
| 76 | +### openapi-validator-middleware.initAsync(pathToSwaggerFile, options) |
| 77 | + |
| 78 | +Initialize the middleware using a swagger definition. |
| 79 | +The function executes asynchronously and the resolved promise does not return anything. |
| 80 | + |
| 81 | +This Initilaztion function also supports schema with references to external files. |
| 82 | + |
| 83 | +- `pathToSwaggerFile`: Path to the swagger definition. |
| 84 | +- `options`: Additional options for the middleware ([see below](#options)). |
73 | 85 |
|
74 | 86 | #### Options |
75 | 87 |
|
|
0 commit comments