// This file is autogenerated by build/build-validation.js, do not edit
/* c8 ignore start */
"use strict";
module.exports = validate10;
module.exports.default = validate10;
const schema11 = {"type":"object","additionalProperties":false,"properties":{"connectionTimeout":{"type":"integer","default":0},"keepAliveTimeout":{"type":"integer","default":72000},"forceCloseConnections":{"oneOf":[{"type":"string","pattern":"idle"},{"type":"boolean"}]},"maxRequestsPerSocket":{"type":"integer","default":0,"nullable":true},"requestTimeout":{"type":"integer","default":0},"bodyLimit":{"type":"integer","default":1048576},"caseSensitive":{"type":"boolean","default":true},"allowUnsafeRegex":{"type":"boolean","default":false},"http2":{"type":"boolean"},"https":{"if":{"not":{"oneOf":[{"type":"boolean"},{"type":"null"},{"type":"object","additionalProperties":false,"required":["allowHTTP1"],"properties":{"allowHTTP1":{"type":"boolean"}}}]}},"then":{"setDefaultValue":true}},"ignoreTrailingSlash":{"type":"boolean","default":false},"ignoreDuplicateSlashes":{"type":"boolean","default":false},"disableRequestLogging":{"default":false},"maxParamLength":{"type":"integer","default":100},"onProtoPoisoning":{"type":"string","default":"error"},"onConstructorPoisoning":{"type":"string","default":"error"},"pluginTimeout":{"type":"integer","default":10000},"requestIdHeader":{"anyOf":[{"type":"boolean"},{"type":"string"}],"default":false},"requestIdLogLabel":{"type":"string","default":"reqId"},"http2SessionTimeout":{"type":"integer","default":72000},"exposeHeadRoutes":{"type":"boolean","default":true},"useSemicolonDelimiter":{"type":"boolean","default":false},"routerOptions":{"type":"object","additionalProperties":true,"properties":{"ignoreTrailingSlash":{"type":"boolean","default":false},"ignoreDuplicateSlashes":{"type":"boolean","default":false},"maxParamLength":{"type":"integer","default":100},"allowUnsafeRegex":{"type":"boolean","default":false},"useSemicolonDelimiter":{"type":"boolean","default":false}}},"constraints":{"type":"object","additionalProperties":{"type":"object","required":["name","storage","validate","deriveConstraint"],"additionalProperties":true,"properties":{"name":{"type":"string"},"storage":{},"validate":{},"deriveConstraint":{}}}}}};
const func2 = Object.prototype.hasOwnProperty;
const pattern0 = new RegExp("idle", "u");

function validate10(data, {instancePath="", parentData, parentDataProperty, rootData=data}={}){
let vErrors = null;
let errors = 0;
if(errors === 0){
if(data && typeof data == "object" && !Array.isArray(data)){
if(data.connectionTimeout === undefined){
data.connectionTimeout = 0;
}
if(data.keepAliveTimeout === undefined){
data.keepAliveTimeout = 72000;
}
if(data.maxRequestsPerSocket === undefined){
data.maxRequestsPerSocket = 0;
}
if(data.requestTimeout === undefined){
data.requestTimeout = 0;
}
if(data.bodyLimit === undefined){
data.bodyLimit = 1048576;
}
if(data.caseSensitive === undefined){
data.caseSensitive = true;
}
if(data.allowUnsafeRegex === undefined){
data.allowUnsafeRegex = false;
}
if(data.ignoreTrailingSlash === undefined){
data.ignoreTrailingSlash = false;
}
if(data.ignoreDuplicateSlashes === undefined){
data.ignoreDuplicateSlashes = false;
}
if(data.disableRequestLogging === undefined){
data.disableRequestLogging = false;
}
if(data.maxParamLength === undefined){
data.maxParamLength = 100;
}
if(data.onProtoPoisoning === undefined){
data.onProtoPoisoning = "error";
}
if(data.onConstructorPoisoning === undefined){
data.onConstructorPoisoning = "error";
}
if(data.pluginTimeout === undefined){
data.pluginTimeout = 10000;
}
if(data.requestIdHeader === undefined){
data.requestIdHeader = false;
}
if(data.requestIdLogLabel === undefined){
data.requestIdLogLabel = "reqId";
}
if(data.http2SessionTimeout === undefined){
data.http2SessionTimeout = 72000;
}
if(data.exposeHeadRoutes === undefined){
data.exposeHeadRoutes = true;
}
if(data.useSemicolonDelimiter === undefined){
data.useSemicolonDelimiter = false;
}
const _errs1 = errors;
for(const key0 in data){
if(!(func2.call(schema11.properties, key0))){
delete data[key0];
}
}
if(_errs1 === errors){
let data0 = data.connectionTimeout;
const _errs2 = errors;
if(!(((typeof data0 == "number") && (!(data0 % 1) && !isNaN(data0))) && (isFinite(data0)))){
let dataType0 = typeof data0;
let coerced0 = undefined;
if(!(coerced0 !== undefined)){
if(dataType0 === "boolean" || data0 === null
              || (dataType0 === "string" && data0 && data0 == +data0 && !(data0 % 1))){
coerced0 = +data0;
}
else {
validate10.errors = [{instancePath:instancePath+"/connectionTimeout",schemaPath:"#/properties/connectionTimeout/type",keyword:"type",params:{type: "integer"},message:"must be integer"}];
return false;
}
}
if(coerced0 !== undefined){
data0 = coerced0;
if(data !== undefined){
data["connectionTimeout"] = coerced0;
}
}
}
var valid0 = _errs2 === errors;
if(valid0){
let data1 = data.keepAliveTimeout;
const _errs4 = errors;
if(!(((typeof data1 == "number") && (!(data1 % 1) && !isNaN(data1))) && (isFinite(data1)))){
let dataType1 = typeof data1;
let coerced1 = undefined;
if(!(coerced1 !== undefined)){
if(dataType1 === "boolean" || data1 === null
              || (dataType1 === "string" && data1 && data1 == +data1 && !(data1 % 1))){
coerced1 = +data1;
}
else {
validate10.errors = [{instancePath:instancePath+"/keepAliveTimeout",schemaPath:"#/properties/keepAliveTimeout/type",keyword:"type",params:{type: "integer"},message:"must be integer"}];
return false;
}
}
if(coerced1 !== undefined){
data1 = coerced1;
if(data !== undefined){
data["keepAliveTimeout"] = coerced1;
}
}
}
var valid0 = _errs4 === errors;
if(valid0){
if(data.forceCloseConnections !== undefined){
let data2 = data.forceCloseConnections;
const _errs6 = errors;
const _errs7 = errors;
let valid1 = false;
let passing0 = null;
const _errs8 = errors;
if(typeof data2 !== "string"){
let dataType2 = typeof data2;
let coerced2 = undefined;
if(!(coerced2 !== undefined)){
if(dataType2 == "number" || dataType2 == "boolean"){
coerced2 = "" + data2;
}
else if(data2 === null){
coerced2 = "";
}
else {
const err0 = {instancePath:instancePath+"/forceCloseConnections",schemaPath:"#/properties/forceCloseConnections/oneOf/0/type",keyword:"type",params:{type: "string"},message:"must be string"};
if(vErrors === null){
vErrors = [err0];
}
else {
vErrors.push(err0);
}
errors++;
}
}
if(coerced2 !== undefined){
data2 = coerced2;
if(data !== undefined){
data["forceCloseConnections"] = coerced2;
}
}
}
if(errors === _errs8){
if(typeof data2 === "string"){
if(!pattern0.test(data2)){
const err1 = {instancePath:instancePath+"/forceCloseConnections",schemaPath:"#/properties/forceCloseConnections/oneOf/0/pattern",keyword:"pattern",params:{pattern: "idle"},message:"must match pattern \""+"idle"+"\""};
if(vErrors === null){
vErrors = [err1];
}
else {
vErrors.push(err1);
}
errors++;
}
}
}
var _valid0 = _errs8 === errors;
if(_valid0){
valid1 = true;
passing0 = 0;
}
const _errs10 = errors;
if(typeof data2 !== "boolean"){
let coerced3 = undefined;
if(!(coerced3 !== undefined)){
if(data2 === "false" || data2 === 0 || data2 === null){
coerced3 = false;
}
else if(data2 === "true" || data2 === 1){
coerced3 = true;
}
else {
const err2 = {instancePath:instancePath+"/forceCloseConnections",schemaPath:"#/properties/forceCloseConnections/oneOf/1/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};
if(vErrors === null){
vErrors = [err2];
}
else {
vErrors.push(err2);
}
errors++;
}
}
if(coerced3 !== undefined){
data2 = coerced3;
if(data !== undefined){
data["forceCloseConnections"] = coerced3;
}
}
}
var _valid0 = _errs10 === errors;
if(_valid0 && valid1){
valid1 = false;
passing0 = [passing0, 1];
}
else {
if(_valid0){
valid1 = true;
passing0 = 1;
}
}
if(!valid1){
const err3 = {instancePath:instancePath+"/forceCloseConnections",schemaPath:"#/properties/forceCloseConnections/oneOf",keyword:"oneOf",params:{passingSchemas: passing0},message:"must match exactly one schema in oneOf"};
if(vErrors === null){
vErrors = [err3];
}
else {
vErrors.push(err3);
}
errors++;
validate10.errors = vErrors;
return false;
}
else {
errors = _errs7;
if(vErrors !== null){
if(_errs7){
vErrors.length = _errs7;
}
else {
vErrors = null;
}
}
}
var valid0 = _errs6 === errors;
}
else {
var valid0 = true;
}
if(valid0){
let data3 = data.maxRequestsPerSocket;
const _errs12 = errors;
if((!(((typeof data3 == "number") && (!(data3 % 1) && !isNaN(data3))) && (isFinite(data3)))) && (data3 !== null)){
let dataType4 = typeof data3;
let coerced4 = undefined;
if(!(coerced4 !== undefined)){
if(dataType4 === "boolean" || data3 === null
              || (dataType4 === "string" && data3 && data3 == +data3 && !(data3 % 1))){
coerced4 = +data3;
}
else if(data3 === "" || data3 === 0 || data3 === false){
coerced4 = null;
}
else {
validate10.errors = [{instancePath:instancePath+"/maxRequestsPerSocket",schemaPath:"#/properties/maxRequestsPerSocket/type",keyword:"type",params:{type: "integer"},message:"must be integer"}];
return false;
}
}
if(coerced4 !== undefined){
data3 = coerced4;
if(data !== undefined){
data["maxRequestsPerSocket"] = coerced4;
}
}
}
var valid0 = _errs12 === errors;
if(valid0){
let data4 = data.requestTimeout;
const _errs15 = errors;
if(!(((typeof data4 == "number") && (!(data4 % 1) && !isNaN(data4))) && (isFinite(data4)))){
let dataType5 = typeof data4;
let coerced5 = undefined;
if(!(coerced5 !== undefined)){
if(dataType5 === "boolean" || data4 === null
              || (dataType5 === "string" && data4 && data4 == +data4 && !(data4 % 1))){
coerced5 = +data4;
}
else {
validate10.errors = [{instancePath:instancePath+"/requestTimeout",schemaPath:"#/properties/requestTimeout/type",keyword:"type",params:{type: "integer"},message:"must be integer"}];
return false;
}
}
if(coerced5 !== undefined){
data4 = coerced5;
if(data !== undefined){
data["requestTimeout"] = coerced5;
}
}
}
var valid0 = _errs15 === errors;
if(valid0){
let data5 = data.bodyLimit;
const _errs17 = errors;
if(!(((typeof data5 == "number") && (!(data5 % 1) && !isNaN(data5))) && (isFinite(data5)))){
let dataType6 = typeof data5;
let coerced6 = undefined;
if(!(coerced6 !== undefined)){
if(dataType6 === "boolean" || data5 === null
              || (dataType6 === "string" && data5 && data5 == +data5 && !(data5 % 1))){
coerced6 = +data5;
}
else {
validate10.errors = [{instancePath:instancePath+"/bodyLimit",schemaPath:"#/properties/bodyLimit/type",keyword:"type",params:{type: "integer"},message:"must be integer"}];
return false;
}
}
if(coerced6 !== undefined){
data5 = coerced6;
if(data !== undefined){
data["bodyLimit"] = coerced6;
}
}
}
var valid0 = _errs17 === errors;
if(valid0){
let data6 = data.caseSensitive;
const _errs19 = errors;
if(typeof data6 !== "boolean"){
let coerced7 = undefined;
if(!(coerced7 !== undefined)){
if(data6 === "false" || data6 === 0 || data6 === null){
coerced7 = false;
}
else if(data6 === "true" || data6 === 1){
coerced7 = true;
}
else {
validate10.errors = [{instancePath:instancePath+"/caseSensitive",schemaPath:"#/properties/caseSensitive/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"}];
return false;
}
}
if(coerced7 !== undefined){
data6 = coerced7;
if(data !== undefined){
data["caseSensitive"] = coerced7;
}
}
}
var valid0 = _errs19 === errors;
if(valid0){
let data7 = data.allowUnsafeRegex;
const _errs21 = errors;
if(typeof data7 !== "boolean"){
let coerced8 = undefined;
if(!(coerced8 !== undefined)){
if(data7 === "false" || data7 === 0 || data7 === null){
coerced8 = false;
}
else if(data7 === "true" || data7 === 1){
coerced8 = true;
}
else {
validate10.errors = [{instancePath:instancePath+"/allowUnsafeRegex",schemaPath:"#/properties/allowUnsafeRegex/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"}];
return false;
}
}
if(coerced8 !== undefined){
data7 = coerced8;
if(data !== undefined){
data["allowUnsafeRegex"] = coerced8;
}
}
}
var valid0 = _errs21 === errors;
if(valid0){
if(data.http2 !== undefined){
let data8 = data.http2;
const _errs23 = errors;
if(typeof data8 !== "boolean"){
let coerced9 = undefined;
if(!(coerced9 !== undefined)){
if(data8 === "false" || data8 === 0 || data8 === null){
coerced9 = false;
}
else if(data8 === "true" || data8 === 1){
coerced9 = true;
}
else {
validate10.errors = [{instancePath:instancePath+"/http2",schemaPath:"#/properties/http2/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"}];
return false;
}
}
if(coerced9 !== undefined){
data8 = coerced9;
if(data !== undefined){
data["http2"] = coerced9;
}
}
}
var valid0 = _errs23 === errors;
}
else {
var valid0 = true;
}
if(valid0){
if(data.https !== undefined){
let data9 = data.https;
const _errs25 = errors;
const _errs26 = errors;
let valid2 = true;
const _errs27 = errors;
const _errs28 = errors;
const _errs29 = errors;
const _errs30 = errors;
let valid4 = false;
let passing1 = null;
const _errs31 = errors;
if(typeof data9 !== "boolean"){
let coerced10 = undefined;
if(!(coerced10 !== undefined)){
if(data9 === "false" || data9 === 0 || data9 === null){
coerced10 = false;
}
else if(data9 === "true" || data9 === 1){
coerced10 = true;
}
else {
const err4 = {};
if(vErrors === null){
vErrors = [err4];
}
else {
vErrors.push(err4);
}
errors++;
}
}
if(coerced10 !== undefined){
data9 = coerced10;
if(data !== undefined){
data["https"] = coerced10;
}
}
}
var _valid2 = _errs31 === errors;
if(_valid2){
valid4 = true;
passing1 = 0;
}
const _errs33 = errors;
if(data9 !== null){
let coerced11 = undefined;
if(!(coerced11 !== undefined)){
if(data9 === "" || data9 === 0 || data9 === false){
coerced11 = null;
}
else {
const err5 = {};
if(vErrors === null){
vErrors = [err5];
}
else {
vErrors.push(err5);
}
errors++;
}
}
if(coerced11 !== undefined){
data9 = coerced11;
if(data !== undefined){
data["https"] = coerced11;
}
}
}
var _valid2 = _errs33 === errors;
if(_valid2 && valid4){
valid4 = false;
passing1 = [passing1, 1];
}
else {
if(_valid2){
valid4 = true;
passing1 = 1;
}
const _errs35 = errors;
if(errors === _errs35){
if(data9 && typeof data9 == "object" && !Array.isArray(data9)){
let missing0;
if((data9.allowHTTP1 === undefined) && (missing0 = "allowHTTP1")){
const err6 = {};
if(vErrors === null){
vErrors = [err6];
}
else {
vErrors.push(err6);
}
errors++;
}
else {
const _errs37 = errors;
for(const key1 in data9){
if(!(key1 === "allowHTTP1")){
delete data9[key1];
}
}
if(_errs37 === errors){
if(data9.allowHTTP1 !== undefined){
let data10 = data9.allowHTTP1;
if(typeof data10 !== "boolean"){
let coerced12 = undefined;
if(!(coerced12 !== undefined)){
if(data10 === "false" || data10 === 0 || data10 === null){
coerced12 = false;
}
else if(data10 === "true" || data10 === 1){
coerced12 = true;
}
else {
const err7 = {};
if(vErrors === null){
vErrors = [err7];
}
else {
vErrors.push(err7);
}
errors++;
}
}
if(coerced12 !== undefined){
data10 = coerced12;
if(data9 !== undefined){
data9["allowHTTP1"] = coerced12;
}
}
}
}
}
}
}
else {
const err8 = {};
if(vErrors === null){
vErrors = [err8];
}
else {
vErrors.push(err8);
}
errors++;
}
}
var _valid2 = _errs35 === errors;
if(_valid2 && valid4){
valid4 = false;
passing1 = [passing1, 2];
}
else {
if(_valid2){
valid4 = true;
passing1 = 2;
}
}
}
if(!valid4){
const err9 = {};
if(vErrors === null){
vErrors = [err9];
}
else {
vErrors.push(err9);
}
errors++;
}
else {
errors = _errs30;
if(vErrors !== null){
if(_errs30){
vErrors.length = _errs30;
}
else {
vErrors = null;
}
}
}
var valid3 = _errs29 === errors;
if(valid3){
const err10 = {};
if(vErrors === null){
vErrors = [err10];
}
else {
vErrors.push(err10);
}
errors++;
}
else {
errors = _errs28;
if(vErrors !== null){
if(_errs28){
vErrors.length = _errs28;
}
else {
vErrors = null;
}
}
}
var _valid1 = _errs27 === errors;
errors = _errs26;
if(vErrors !== null){
if(_errs26){
vErrors.length = _errs26;
}
else {
vErrors = null;
}
}
if(_valid1){
const _errs40 = errors;
data["https"] = true;
var _valid1 = _errs40 === errors;
valid2 = _valid1;
}
if(!valid2){
const err11 = {instancePath:instancePath+"/https",schemaPath:"#/properties/https/if",keyword:"if",params:{failingKeyword: "then"},message:"must match \"then\" schema"};
if(vErrors === null){
vErrors = [err11];
}
else {
vErrors.push(err11);
}
errors++;
validate10.errors = vErrors;
return false;
}
var valid0 = _errs25 === errors;
}
else {
var valid0 = true;
}
if(valid0){
let data11 = data.ignoreTrailingSlash;
const _errs41 = errors;
if(typeof data11 !== "boolean"){
let coerced13 = undefined;
if(!(coerced13 !== undefined)){
if(data11 === "false" || data11 === 0 || data11 === null){
coerced13 = false;
}
else if(data11 === "true" || data11 === 1){
coerced13 = true;
}
else {
validate10.errors = [{instancePath:instancePath+"/ignoreTrailingSlash",schemaPath:"#/properties/ignoreTrailingSlash/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"}];
return false;
}
}
if(coerced13 !== undefined){
data11 = coerced13;
if(data !== undefined){
data["ignoreTrailingSlash"] = coerced13;
}
}
}
var valid0 = _errs41 === errors;
if(valid0){
let data12 = data.ignoreDuplicateSlashes;
const _errs43 = errors;
if(typeof data12 !== "boolean"){
let coerced14 = undefined;
if(!(coerced14 !== undefined)){
if(data12 === "false" || data12 === 0 || data12 === null){
coerced14 = false;
}
else if(data12 === "true" || data12 === 1){
coerced14 = true;
}
else {
validate10.errors = [{instancePath:instancePath+"/ignoreDuplicateSlashes",schemaPath:"#/properties/ignoreDuplicateSlashes/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"}];
return false;
}
}
if(coerced14 !== undefined){
data12 = coerced14;
if(data !== undefined){
data["ignoreDuplicateSlashes"] = coerced14;
}
}
}
var valid0 = _errs43 === errors;
if(valid0){
let data13 = data.maxParamLength;
const _errs45 = errors;
if(!(((typeof data13 == "number") && (!(data13 % 1) && !isNaN(data13))) && (isFinite(data13)))){
let dataType15 = typeof data13;
let coerced15 = undefined;
if(!(coerced15 !== undefined)){
if(dataType15 === "boolean" || data13 === null
              || (dataType15 === "string" && data13 && data13 == +data13 && !(data13 % 1))){
coerced15 = +data13;
}
else {
validate10.errors = [{instancePath:instancePath+"/maxParamLength",schemaPath:"#/properties/maxParamLength/type",keyword:"type",params:{type: "integer"},message:"must be integer"}];
return false;
}
}
if(coerced15 !== undefined){
data13 = coerced15;
if(data !== undefined){
data["maxParamLength"] = coerced15;
}
}
}
var valid0 = _errs45 === errors;
if(valid0){
let data14 = data.onProtoPoisoning;
const _errs47 = errors;
if(typeof data14 !== "string"){
let dataType16 = typeof data14;
let coerced16 = undefined;
if(!(coerced16 !== undefined)){
if(dataType16 == "number" || dataType16 == "boolean"){
coerced16 = "" + data14;
}
else if(data14 === null){
coerced16 = "";
}
else {
validate10.errors = [{instancePath:instancePath+"/onProtoPoisoning",schemaPath:"#/properties/onProtoPoisoning/type",keyword:"type",params:{type: "string"},message:"must be string"}];
return false;
}
}
if(coerced16 !== undefined){
data14 = coerced16;
if(data !== undefined){
data["onProtoPoisoning"] = coerced16;
}
}
}
var valid0 = _errs47 === errors;
if(valid0){
let data15 = data.onConstructorPoisoning;
const _errs49 = errors;
if(typeof data15 !== "string"){
let dataType17 = typeof data15;
let coerced17 = undefined;
if(!(coerced17 !== undefined)){
if(dataType17 == "number" || dataType17 == "boolean"){
coerced17 = "" + data15;
}
else if(data15 === null){
coerced17 = "";
}
else {
validate10.errors = [{instancePath:instancePath+"/onConstructorPoisoning",schemaPath:"#/properties/onConstructorPoisoning/type",keyword:"type",params:{type: "string"},message:"must be string"}];
return false;
}
}
if(coerced17 !== undefined){
data15 = coerced17;
if(data !== undefined){
data["onConstructorPoisoning"] = coerced17;
}
}
}
var valid0 = _errs49 === errors;
if(valid0){
let data16 = data.pluginTimeout;
const _errs51 = errors;
if(!(((typeof data16 == "number") && (!(data16 % 1) && !isNaN(data16))) && (isFinite(data16)))){
let dataType18 = typeof data16;
let coerced18 = undefined;
if(!(coerced18 !== undefined)){
if(dataType18 === "boolean" || data16 === null
              || (dataType18 === "string" && data16 && data16 == +data16 && !(data16 % 1))){
coerced18 = +data16;
}
else {
validate10.errors = [{instancePath:instancePath+"/pluginTimeout",schemaPath:"#/properties/pluginTimeout/type",keyword:"type",params:{type: "integer"},message:"must be integer"}];
return false;
}
}
if(coerced18 !== undefined){
data16 = coerced18;
if(data !== undefined){
data["pluginTimeout"] = coerced18;
}
}
}
var valid0 = _errs51 === errors;
if(valid0){
let data17 = data.requestIdHeader;
const _errs53 = errors;
const _errs54 = errors;
let valid6 = false;
const _errs55 = errors;
if(typeof data17 !== "boolean"){
let coerced19 = undefined;
if(!(coerced19 !== undefined)){
if(data17 === "false" || data17 === 0 || data17 === null){
coerced19 = false;
}
else if(data17 === "true" || data17 === 1){
coerced19 = true;
}
else {
const err12 = {instancePath:instancePath+"/requestIdHeader",schemaPath:"#/properties/requestIdHeader/anyOf/0/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};
if(vErrors === null){
vErrors = [err12];
}
else {
vErrors.push(err12);
}
errors++;
}
}
if(coerced19 !== undefined){
data17 = coerced19;
if(data !== undefined){
data["requestIdHeader"] = coerced19;
}
}
}
var _valid3 = _errs55 === errors;
valid6 = valid6 || _valid3;
if(!valid6){
const _errs57 = errors;
if(typeof data17 !== "string"){
let dataType20 = typeof data17;
let coerced20 = undefined;
if(!(coerced20 !== undefined)){
if(dataType20 == "number" || dataType20 == "boolean"){
coerced20 = "" + data17;
}
else if(data17 === null){
coerced20 = "";
}
else {
const err13 = {instancePath:instancePath+"/requestIdHeader",schemaPath:"#/properties/requestIdHeader/anyOf/1/type",keyword:"type",params:{type: "string"},message:"must be string"};
if(vErrors === null){
vErrors = [err13];
}
else {
vErrors.push(err13);
}
errors++;
}
}
if(coerced20 !== undefined){
data17 = coerced20;
if(data !== undefined){
data["requestIdHeader"] = coerced20;
}
}
}
var _valid3 = _errs57 === errors;
valid6 = valid6 || _valid3;
}
if(!valid6){
const err14 = {instancePath:instancePath+"/requestIdHeader",schemaPath:"#/properties/requestIdHeader/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};
if(vErrors === null){
vErrors = [err14];
}
else {
vErrors.push(err14);
}
errors++;
validate10.errors = vErrors;
return false;
}
else {
errors = _errs54;
if(vErrors !== null){
if(_errs54){
vErrors.length = _errs54;
}
else {
vErrors = null;
}
}
}
var valid0 = _errs53 === errors;
if(valid0){
let data18 = data.requestIdLogLabel;
const _errs59 = errors;
if(typeof data18 !== "string"){
let dataType21 = typeof data18;
let coerced21 = undefined;
if(!(coerced21 !== undefined)){
if(dataType21 == "number" || dataType21 == "boolean"){
coerced21 = "" + data18;
}
else if(data18 === null){
coerced21 = "";
}
else {
validate10.errors = [{instancePath:instancePath+"/requestIdLogLabel",schemaPath:"#/properties/requestIdLogLabel/type",keyword:"type",params:{type: "string"},message:"must be string"}];
return false;
}
}
if(coerced21 !== undefined){
data18 = coerced21;
if(data !== undefined){
data["requestIdLogLabel"] = coerced21;
}
}
}
var valid0 = _errs59 === errors;
if(valid0){
let data19 = data.http2SessionTimeout;
const _errs61 = errors;
if(!(((typeof data19 == "number") && (!(data19 % 1) && !isNaN(data19))) && (isFinite(data19)))){
let dataType22 = typeof data19;
let coerced22 = undefined;
if(!(coerced22 !== undefined)){
if(dataType22 === "boolean" || data19 === null
              || (dataType22 === "string" && data19 && data19 == +data19 && !(data19 % 1))){
coerced22 = +data19;
}
else {
validate10.errors = [{instancePath:instancePath+"/http2SessionTimeout",schemaPath:"#/properties/http2SessionTimeout/type",keyword:"type",params:{type: "integer"},message:"must be integer"}];
return false;
}
}
if(coerced22 !== undefined){
data19 = coerced22;
if(data !== undefined){
data["http2SessionTimeout"] = coerced22;
}
}
}
var valid0 = _errs61 === errors;
if(valid0){
let data20 = data.exposeHeadRoutes;
const _errs63 = errors;
if(typeof data20 !== "boolean"){
let coerced23 = undefined;
if(!(coerced23 !== undefined)){
if(data20 === "false" || data20 === 0 || data20 === null){
coerced23 = false;
}
else if(data20 === "true" || data20 === 1){
coerced23 = true;
}
else {
validate10.errors = [{instancePath:instancePath+"/exposeHeadRoutes",schemaPath:"#/properties/exposeHeadRoutes/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"}];
return false;
}
}
if(coerced23 !== undefined){
data20 = coerced23;
if(data !== undefined){
data["exposeHeadRoutes"] = coerced23;
}
}
}
var valid0 = _errs63 === errors;
if(valid0){
let data21 = data.useSemicolonDelimiter;
const _errs65 = errors;
if(typeof data21 !== "boolean"){
let coerced24 = undefined;
if(!(coerced24 !== undefined)){
if(data21 === "false" || data21 === 0 || data21 === null){
coerced24 = false;
}
else if(data21 === "true" || data21 === 1){
coerced24 = true;
}
else {
validate10.errors = [{instancePath:instancePath+"/useSemicolonDelimiter",schemaPath:"#/properties/useSemicolonDelimiter/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"}];
return false;
}
}
if(coerced24 !== undefined){
data21 = coerced24;
if(data !== undefined){
data["useSemicolonDelimiter"] = coerced24;
}
}
}
var valid0 = _errs65 === errors;
if(valid0){
if(data.routerOptions !== undefined){
let data22 = data.routerOptions;
const _errs67 = errors;
if(errors === _errs67){
if(data22 && typeof data22 == "object" && !Array.isArray(data22)){
if(data22.ignoreTrailingSlash === undefined){
data22.ignoreTrailingSlash = false;
}
if(data22.ignoreDuplicateSlashes === undefined){
data22.ignoreDuplicateSlashes = false;
}
if(data22.maxParamLength === undefined){
data22.maxParamLength = 100;
}
if(data22.allowUnsafeRegex === undefined){
data22.allowUnsafeRegex = false;
}
if(data22.useSemicolonDelimiter === undefined){
data22.useSemicolonDelimiter = false;
}
let data23 = data22.ignoreTrailingSlash;
const _errs70 = errors;
if(typeof data23 !== "boolean"){
let coerced25 = undefined;
if(!(coerced25 !== undefined)){
if(data23 === "false" || data23 === 0 || data23 === null){
coerced25 = false;
}
else if(data23 === "true" || data23 === 1){
coerced25 = true;
}
else {
validate10.errors = [{instancePath:instancePath+"/routerOptions/ignoreTrailingSlash",schemaPath:"#/properties/routerOptions/properties/ignoreTrailingSlash/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"}];
return false;
}
}
if(coerced25 !== undefined){
data23 = coerced25;
if(data22 !== undefined){
data22["ignoreTrailingSlash"] = coerced25;
}
}
}
var valid7 = _errs70 === errors;
if(valid7){
let data24 = data22.ignoreDuplicateSlashes;
const _errs72 = errors;
if(typeof data24 !== "boolean"){
let coerced26 = undefined;
if(!(coerced26 !== undefined)){
if(data24 === "false" || data24 === 0 || data24 === null){
coerced26 = false;
}
else if(data24 === "true" || data24 === 1){
coerced26 = true;
}
else {
validate10.errors = [{instancePath:instancePath+"/routerOptions/ignoreDuplicateSlashes",schemaPath:"#/properties/routerOptions/properties/ignoreDuplicateSlashes/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"}];
return false;
}
}
if(coerced26 !== undefined){
data24 = coerced26;
if(data22 !== undefined){
data22["ignoreDuplicateSlashes"] = coerced26;
}
}
}
var valid7 = _errs72 === errors;
if(valid7){
let data25 = data22.maxParamLength;
const _errs74 = errors;
if(!(((typeof data25 == "number") && (!(data25 % 1) && !isNaN(data25))) && (isFinite(data25)))){
let dataType27 = typeof data25;
let coerced27 = undefined;
if(!(coerced27 !== undefined)){
if(dataType27 === "boolean" || data25 === null
              || (dataType27 === "string" && data25 && data25 == +data25 && !(data25 % 1))){
coerced27 = +data25;
}
else {
validate10.errors = [{instancePath:instancePath+"/routerOptions/maxParamLength",schemaPath:"#/properties/routerOptions/properties/maxParamLength/type",keyword:"type",params:{type: "integer"},message:"must be integer"}];
return false;
}
}
if(coerced27 !== undefined){
data25 = coerced27;
if(data22 !== undefined){
data22["maxParamLength"] = coerced27;
}
}
}
var valid7 = _errs74 === errors;
if(valid7){
let data26 = data22.allowUnsafeRegex;
const _errs76 = errors;
if(typeof data26 !== "boolean"){
let coerced28 = undefined;
if(!(coerced28 !== undefined)){
if(data26 === "false" || data26 === 0 || data26 === null){
coerced28 = false;
}
else if(data26 === "true" || data26 === 1){
coerced28 = true;
}
else {
validate10.errors = [{instancePath:instancePath+"/routerOptions/allowUnsafeRegex",schemaPath:"#/properties/routerOptions/properties/allowUnsafeRegex/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"}];
return false;
}
}
if(coerced28 !== undefined){
data26 = coerced28;
if(data22 !== undefined){
data22["allowUnsafeRegex"] = coerced28;
}
}
}
var valid7 = _errs76 === errors;
if(valid7){
let data27 = data22.useSemicolonDelimiter;
const _errs78 = errors;
if(typeof data27 !== "boolean"){
let coerced29 = undefined;
if(!(coerced29 !== undefined)){
if(data27 === "false" || data27 === 0 || data27 === null){
coerced29 = false;
}
else if(data27 === "true" || data27 === 1){
coerced29 = true;
}
else {
validate10.errors = [{instancePath:instancePath+"/routerOptions/useSemicolonDelimiter",schemaPath:"#/properties/routerOptions/properties/useSemicolonDelimiter/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"}];
return false;
}
}
if(coerced29 !== undefined){
data27 = coerced29;
if(data22 !== undefined){
data22["useSemicolonDelimiter"] = coerced29;
}
}
}
var valid7 = _errs78 === errors;
}
}
}
}
}
else {
validate10.errors = [{instancePath:instancePath+"/routerOptions",schemaPath:"#/properties/routerOptions/type",keyword:"type",params:{type: "object"},message:"must be object"}];
return false;
}
}
var valid0 = _errs67 === errors;
}
else {
var valid0 = true;
}
if(valid0){
if(data.constraints !== undefined){
let data28 = data.constraints;
const _errs80 = errors;
if(errors === _errs80){
if(data28 && typeof data28 == "object" && !Array.isArray(data28)){
for(const key2 in data28){
let data29 = data28[key2];
const _errs83 = errors;
if(errors === _errs83){
if(data29 && typeof data29 == "object" && !Array.isArray(data29)){
let missing1;
if(((((data29.name === undefined) && (missing1 = "name")) || ((data29.storage === undefined) && (missing1 = "storage"))) || ((data29.validate === undefined) && (missing1 = "validate"))) || ((data29.deriveConstraint === undefined) && (missing1 = "deriveConstraint"))){
validate10.errors = [{instancePath:instancePath+"/constraints/" + key2.replace(/~/g, "~0").replace(/\//g, "~1"),schemaPath:"#/properties/constraints/additionalProperties/required",keyword:"required",params:{missingProperty: missing1},message:"must have required property '"+missing1+"'"}];
return false;
}
else {
if(data29.name !== undefined){
let data30 = data29.name;
if(typeof data30 !== "string"){
let dataType30 = typeof data30;
let coerced30 = undefined;
if(!(coerced30 !== undefined)){
if(dataType30 == "number" || dataType30 == "boolean"){
coerced30 = "" + data30;
}
else if(data30 === null){
coerced30 = "";
}
else {
validate10.errors = [{instancePath:instancePath+"/constraints/" + key2.replace(/~/g, "~0").replace(/\//g, "~1")+"/name",schemaPath:"#/properties/constraints/additionalProperties/properties/name/type",keyword:"type",params:{type: "string"},message:"must be string"}];
return false;
}
}
if(coerced30 !== undefined){
data30 = coerced30;
if(data29 !== undefined){
data29["name"] = coerced30;
}
}
}
}
}
}
else {
validate10.errors = [{instancePath:instancePath+"/constraints/" + key2.replace(/~/g, "~0").replace(/\//g, "~1"),schemaPath:"#/properties/constraints/additionalProperties/type",keyword:"type",params:{type: "object"},message:"must be object"}];
return false;
}
}
var valid8 = _errs83 === errors;
if(!valid8){
break;
}
}
}
else {
validate10.errors = [{instancePath:instancePath+"/constraints",schemaPath:"#/properties/constraints/type",keyword:"type",params:{type: "object"},message:"must be object"}];
return false;
}
}
var valid0 = _errs80 === errors;
}
else {
var valid0 = true;
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
else {
validate10.errors = [{instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"}];
return false;
}
}
validate10.errors = vErrors;
return errors === 0;
}


module.exports.defaultInitOptions = {"connectionTimeout":0,"keepAliveTimeout":72000,"maxRequestsPerSocket":0,"requestTimeout":0,"bodyLimit":1048576,"caseSensitive":true,"allowUnsafeRegex":false,"disableRequestLogging":false,"ignoreTrailingSlash":false,"ignoreDuplicateSlashes":false,"maxParamLength":100,"onProtoPoisoning":"error","onConstructorPoisoning":"error","pluginTimeout":10000,"requestIdHeader":false,"requestIdLogLabel":"reqId","http2SessionTimeout":72000,"exposeHeadRoutes":true,"useSemicolonDelimiter":false,"allowErrorHandlerOverride":true,"routerOptions":{"ignoreTrailingSlash":false,"ignoreDuplicateSlashes":false,"maxParamLength":100,"allowUnsafeRegex":false,"useSemicolonDelimiter":false}}
/* c8 ignore stop */
