ocpp-rpc
    Preparing search index...

    Function createValidator

    • Creates a Validator object which can be used with the strictModeValidators option of RPCServer or RPCClient to enable strict schema validation for a given subprotocol.

      Parameters

      • subprotocol: string

        The websocket subprotocol this Validator is targeting

      • schemaObjOrPath: string | object | any[]

        An array or object containing JSON Schemas. Alternatively, a path to a location where a JSON schema (or schemas) can be found.

      • Optionaloptions: {
            confSuffix?: string;
            reqSuffix?: string;
            urnNid?: string;
            version?: "draft-04" | "draft-06" | "draft-07";
        }
        • OptionalconfSuffix?: string

          The response schema ID suffix (e.g. ".conf" or "Response"). Defaults to ".conf" for backwards compatibility.

        • OptionalreqSuffix?: string

          The request schema ID suffix (e.g. ".req" or "Request"). Defaults to ".req" for backwards compatibility.

        • OptionalurnNid?: string

          The common namespace ID (nid) used in the URN of all schema IDs in the collection

        • Optionalversion?: "draft-04" | "draft-06" | "draft-07"

          The JSON schema version used by this validator

      Returns Validator