Skip to content

library: Consider exporting validator classes, not just raw schemas #105

Open
@untitaker

Description

@untitaker

Our Rust and Python libraries currently export schema objects that users can then plug into their favorite JSON schema validator library. This was intentionally done so because we did not want to be prescriptive of what people want to do with it. People could choose to use arroyo's codecs or write their own glue code.

I think it would make sense to move arroyo's codecs into this library, and replicate them into Rust as well, for three reasons:

  • @jjbayer has provided feedback here that the ingest team would not like to maintain that code

  • A story for msgpack #104 might require us to make proprietary extensions to JSON-schema that are incompatible with generic JSON-schema validators out there

  • We could write validators that both 1) perform validation 2) return the correct Python type

    def get_event(message: Any) -> EventV1:
        # invoke fastjsonschema here and perform typing.cast
        ...
    

Needs more thought. Proprietary extensions to JSON schema are unlikely to be desirable if they make it impossible to use off the shelf validation libraries.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions