From a64b1bc8beeddd4017a9ba22fc6b474d1affab9a Mon Sep 17 00:00:00 2001 From: Carmine DiMascio Date: Sun, 15 Sep 2019 16:26:55 -0400 Subject: [PATCH] add response validation to readme --- README.md | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index e1f7eee4..a60090bf 100644 --- a/README.md +++ b/README.md @@ -25,6 +25,8 @@ Install the openapi validator ```javascript new OpenApiValidator({ apiSpec: './test/resources/openapi.yaml', + validateRequests: true, // (default) + validateResponses: true, // false by default }).install(app); ``` @@ -67,6 +69,16 @@ new OpenApiValidator(options).install(app); **`apiSpec:`** a string value specifying the path to the OpenAPI 3.0.x spec or a JSON object representing an OpenAPI spec. +**`validateRequests:`** enable response validation. + +- true - (default) validate requests +- false - do not validate requests + +**`validateResponses:`** enable response validation. + +- true - validate responses +- false - (default) do not validate responses + **`coerceTypes:`** change data type of data to match type keyword. See the example in Coercing data types and coercion rules. Option values: - true - (default) coerce scalar data types. @@ -75,7 +87,6 @@ new OpenApiValidator(options).install(app); **`multerOpts:`** the [multer opts](https://github.com/expressjs/multer) to passthrough to multer - ## Example Express API Server Try the complete example below: