kubernetes-models
Version:
1 lines • 2.77 kB
JavaScript
export const validate=validate0;import{validate as validate2}from"./IoK8sApiAdmissionregistrationV1ApplyConfiguration.js";function validate1(data,{instancePath="",parentData,parentDataProperty,rootData=data}={}){let vErrors=null,errors=0;return null!==data&&(validate2(data,{instancePath,parentData,parentDataProperty,rootData})||(errors=(vErrors=null===vErrors?validate2.errors:vErrors.concat(validate2.errors)).length)),validate1.errors=vErrors,0===errors}import{validate as validate6}from"./IoK8sApiAdmissionregistrationV1JSONPatch.js";function validate5(data,{instancePath="",parentData,parentDataProperty,rootData=data}={}){let vErrors=null,errors=0;return null!==data&&(validate6(data,{instancePath,parentData,parentDataProperty,rootData})||(errors=(vErrors=null===vErrors?validate6.errors:vErrors.concat(validate6.errors)).length)),validate5.errors=vErrors,0===errors}let schema5_enum=["ApplyConfiguration","JSONPatch"];function validate9(data,{instancePath="",parentData,parentDataProperty,rootData=data}={}){let vErrors=null,errors=0;if("string"!=typeof data){let err0={instancePath,schemaPath:"#/type",keyword:"type",params:{type:"string"}};null===vErrors?vErrors=[err0]:vErrors.push(err0),errors++}if("ApplyConfiguration"!==data&&"JSONPatch"!==data){let err1={instancePath,schemaPath:"#/enum",keyword:"enum",params:{allowedValues:schema5_enum}};null===vErrors?vErrors=[err1]:vErrors.push(err1),errors++}return validate9.errors=vErrors,0===errors}function validate0(data,{instancePath="",parentData,parentDataProperty,rootData=data}={}){let vErrors=null,errors=0;if(data&&"object"==typeof data&&!Array.isArray(data)){if(void 0===data.patchType){let err0={instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty:"patchType"}};null===vErrors?vErrors=[err0]:vErrors.push(err0),errors++}void 0!==data.applyConfiguration&&(validate1(data.applyConfiguration,{instancePath:instancePath+"/applyConfiguration",parentData:data,parentDataProperty:"applyConfiguration",rootData})||(errors=(vErrors=null===vErrors?validate1.errors:vErrors.concat(validate1.errors)).length)),void 0!==data.jsonPatch&&(validate5(data.jsonPatch,{instancePath:instancePath+"/jsonPatch",parentData:data,parentDataProperty:"jsonPatch",rootData})||(errors=(vErrors=null===vErrors?validate5.errors:vErrors.concat(validate5.errors)).length)),void 0!==data.patchType&&(validate9(data.patchType,{instancePath:instancePath+"/patchType",parentData:data,parentDataProperty:"patchType",rootData})||(errors=(vErrors=null===vErrors?validate9.errors:vErrors.concat(validate9.errors)).length))}else{let err1={instancePath,schemaPath:"#/type",keyword:"type",params:{type:"object"}};null===vErrors?vErrors=[err1]:vErrors.push(err1),errors++}return validate0.errors=vErrors,0===errors}