Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

runtime return type of schema should match its declaration #977

Open
tom-thorne opened this issue Dec 5, 2024 · 0 comments
Open

runtime return type of schema should match its declaration #977

tom-thorne opened this issue Dec 5, 2024 · 0 comments

Comments

@tom-thorne
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant