+ JSON.stringify(validate.errors, undefined, 2)
+ )
+ }
+
+ protected handleRequestClearCache (chargingStation: ChargingStation): ClearCacheResponse {
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
+ if (chargingStation.idTagsCache.deleteIdTags(getIdTagsFile(chargingStation.stationInfo!)!)) {
+ return OCPPConstants.OCPP_RESPONSE_ACCEPTED
+ }
+ return OCPPConstants.OCPP_RESPONSE_REJECTED
+ }
+
+ private getJsonIncomingRequestValidateFunction<T extends JsonType>(
+ commandName: IncomingRequestCommand,
+ schema: JSONSchemaType<T>
+ ): ValidateFunction<JsonType> {
+ if (!this.jsonValidateFunctions.has(commandName)) {
+ this.jsonValidateFunctions.set(commandName, this.ajv.compile<T>(schema).bind(this))
+ }
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
+ return this.jsonValidateFunctions.get(commandName)!