Skip to content

runtime return type of schema should match its declaration #977

@tom-thorne

Description

@tom-thorne

We've been adding our own library wrapper around model in order to assert validation levels and extend the model with new functions. As a result, we are relying on the return type of schema.

However, our code fails at runtime since the actual type returned from schema isn't a [SchemaType<TProperties, TOptions>, TOptions]. It is instead an object of some sort. Looking at the project source, this appears to be by design.

It would be better (in my opinion) if the return type of schema matched its own declaration, and the fixup to the internal runtime type occurred within model

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