@@ -148,12 +148,12 @@ const server = app.listen(serverPort, () => {});
148148const Koa = require (' koa' );
149149const Router = require (' koa-router' );
150150const bodyParser = require (' koa-bodyparser' );
151- const inputValidation = require (' ../../src/ middleware' );
151+ const inputValidation = require (' openapi-validator- middleware' );
152152let app = new Koa ();
153153let router = new Router ();
154154app .use (bodyParser ());
155155app .use (router .routes ());
156- module .exports = inputValidation .init (' test/pet-store-swagger.yaml' , {framework: ' koa' });
156+ module .exports = inputValidation .init (' test/pet-store-swagger.yaml' , { framework: ' koa' });
157157router .get (' /pets' , inputValidation .validate , async (ctx , next ) => {
158158 ctx .status = 200 ;
159159 ctx .body = { result: ' OK' };
@@ -178,7 +178,7 @@ return app;
178178``` js
179179' use strict' ;
180180const fastify = require (' fastify' );
181- const inputValidation = require (' ../../src/ middleware' );
181+ const inputValidation = require (' openapi-validator- middleware' );
182182
183183async function getApp () {
184184 inputValidation .init (' test/pet-store-swagger.yaml' , {
@@ -209,7 +209,7 @@ async function getApp() {
209209
210210### multiple-instances
211211``` js
212- const inputValidation = require (' ../../src/ middleware' );
212+ const inputValidation = require (' openapi-validator- middleware' );
213213const validatorA = inputValidation .getNewMiddleware (' test/pet-store-swaggerA.yaml' , {framework: ' express' });
214214const validatorB = inputValidation .getNewMiddleware (' test/pet-store-swaggerB.yaml' , {framework: ' express' });
215215
@@ -234,12 +234,12 @@ Multipart/form-data (files) support is based on [`express/multer`](https://githu
234234
235235### Fastify support
236236
237- Fastify support requires ` uri-js ` dependency to be available .
238- When using this package as middleware for fastify, the validations errors are being thrown.
237+ Fastify support requires ` uri-js ` dependency to be installed. Make sure to run ` npm install uri-js ` .
238+ When using this package as a middleware for fastify, the validations errors will be thrown.
239239
240240### Koa support
241241
242- When using this package as middleware for koa, the validations errors are being thrown.
242+ When using this package as middleware for koa, the validations errors will be thrown.
243243
244244### Koa packages
245245
0 commit comments