X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Fcharging-station%2Focpp%2FOCPPResponseService.ts;h=0aedbb1eebb5b6a17a2abe94b2b85641c68c07e9;hb=1a6188b2fcd2bf644e6fea0c697a095228c1aed0;hp=90f92169cd4c76f8a49f37fc3635a4778689cd86;hpb=291b5ec8b20005de53c4de3eba0e4cd1b068006c;p=e-mobility-charging-stations-simulator.git diff --git a/src/charging-station/ocpp/OCPPResponseService.ts b/src/charging-station/ocpp/OCPPResponseService.ts index 90f92169..0aedbb1e 100644 --- a/src/charging-station/ocpp/OCPPResponseService.ts +++ b/src/charging-station/ocpp/OCPPResponseService.ts @@ -68,14 +68,11 @@ export abstract class OCPPResponseService { schema: JSONSchemaType, payload: T, ): boolean { - if (chargingStation.getOcppStrictCompliance() === false) { + if (chargingStation.stationInfo?.ocppStrictCompliance === false) { return true; } if (this.jsonRequestValidateFunctions.has(commandName) === false) { - this.jsonRequestValidateFunctions.set( - commandName, - this.ajv.compile(schema).bind(this), - ); + this.jsonRequestValidateFunctions.set(commandName, this.ajv.compile(schema).bind(this)); } const validate = this.jsonRequestValidateFunctions.get(commandName)!; if (validate(payload)) { @@ -86,7 +83,7 @@ export abstract class OCPPResponseService { validate.errors, ); throw new OCPPError( - OCPPServiceUtils.ajvErrorsToErrorType(validate.errors!), + OCPPServiceUtils.ajvErrorsToErrorType(validate.errors), 'Response PDU is invalid', commandName, JSON.stringify(validate.errors, undefined, 2),