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.
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
rawas the carrier of the original text:A. Relax
messageTypewhenrawis present. A record may omitmessageTypeand the other frame-derived fields if it carriesraw. Consumers treat such records as opaque: counted and displayed, never correlated.B. A dedicated kind, e.g.
messageType: "MALFORMED". Explicit and self-describing, andmessageTypestays 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.