▪️ validateRequests
Determines whether the validator should validate requests.
Option-schema
validateRequests (optional)
true
(default) - validate requests.false
- do not validate requests.-
{ ... }
- validate requests with options-
coerceTypes
Determines whether the validator will coerce the request body. Request query and path params, headers, cookies are coerced by default and this setting does not affect that.
See additional details on coercion and limitiations.
Option Schema
true
- coerce scalar data types.false
- (default) do not coerce types. (more strict, safer)"array"
- in addition to coercions between scalar types, coerce scalar data to an array with one element and vice versa (as required by the schema).
-
allowUnknownQueryParameters
Determines whether to allow undefined query parameters to pass validation.
Option Schema
-true
- enables unknown/undeclared query parameters to pass validation -false
- (default) fail validation if an unknown query parameter is presentNote
allowUnknownQueryParameters
is set for the globally on the validator. It can be overwritten on a per-operation basis by using the custom OpenAPI vendor extensionx-allow-unknown-query-parameters
.The following example allows unknown query parameters for the annotated endpoint:
-
removeAdditional
Determines whether to keep or remove additional properties in request body or to fail validation if schema has
additionalProperties
set tofalse
. For further details, refer to AJV documentationOption Schema
-false
(default) - not to remove additional properties -"all"
- all additional properties are removed, regardless of additionalProperties keyword in schema (and no validation is made for them). -true
- only additional properties with additionalProperties keyword equal to false are removed. -"failing"
- additional properties that fail request schema validation will be removed (where additionalProperties keyword is false or schema).
-