From 7f07d8594f773fa9248dfbdf9b03150041151ab2 Mon Sep 17 00:00:00 2001 From: Carmine DiMascio Date: Fri, 22 Mar 2019 12:53:50 -0400 Subject: [PATCH] Update README.md --- README.md | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index f4b5895a..903bd5dc 100644 --- a/README.md +++ b/README.md @@ -30,15 +30,17 @@ new OpenApiMiddleware({ ```javascript new OpenApiMiddleware({ + + // required: path to an openapi 3 spec apiSpecPath: './openapi.yaml', - // default is true - // validates the openapi spec, throws if invalid + + // default true: validates the openapi spec, throws if invalid validateApiDoc: true, - // default is true - // attempts to coerce a value's type to that defined in the openapi spec + + // default: trueattempts to coerce a value's type to that defined in the openapi spec enableObjectCoercion: true, - // default is undefined - // provide a custom error transform to customize how errors are shaped + + // optional: provide a custom error transform to customize how errors are shaped errorTransform: validationResult => ({ // the http status code to return statusCode: validationResult.status,