Skip to content

Run checks against protocol schemas #50

@jonnor

Description

@jonnor

There now exists some JSON schemas which formally describes the protocol, at https://github.com/flowbased/fbp-protocol

We should make it hard to do things which are incompatible/wrong according to the protocol, so we should check both sent and received messages against the JSON schemas.

Initially there are likely incompatiblities between existing implementations and current schemas, either due to bugs in runtime/client following protocol spec, or due to bugs in the schemas. So probably the checks should not fail, but instead raise a warning.

Since the BaseRuntime is an EventEmitter already, I propose we emit a validation-error event. And that we log these warnings, so people are more likely to discover and fix them.

For forward compatibility, unknown messages (not existing in schema) should be ignored. We could emit a unknown-message, and allow to opt-in to log these.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions