Skip to content

Representing frames that do not parse as OCPP-J #2

Description

@sepehr-safari

v1.1 requires messageType, so a frame that does not parse as an OCPP-J array cannot be represented as a record at all: truncated frames, non-array JSON, non-JSON text. That is exactly the traffic a debugging workflow most wants to move between tools, and it was flagged as a known limitation when v1.1 landed (shiv3/ocpp-cp-simulator#216).

Two shapes I can see, both keeping raw as the carrier of the original text:

A. Relax messageType when raw is present. A record may omit messageType and the other frame-derived fields if it carries raw. Consumers treat such records as opaque: counted and displayed, never correlated.

B. A dedicated kind, e.g. messageType: "MALFORMED". Explicit and self-describing, and messageType stays required.

Either way there is a versioning question to face honestly: a trace containing such records will fail validation for consumers pinned to today's schema. Since no current producer emits them, no existing trace breaks, but per the versioning rules this looks closer to a new major than a minor. That is worth deciding deliberately rather than inheriting.

Once a direction is picked I can add the corresponding fixtures (truncated frame, non-array JSON, non-JSON text) with their expected consumer views.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions