You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've tried switching from GenericSchema to ObjectSchema, checked suggested way in other issues and passed Schema type to flatten. For whatever reason the message type is unknown
Schema is a generic ObjectSchema and will never be strongly typed. Therefore, passing Schema to flatten has no advantage. What behavior did you expect? Maybe there is something we can do better. We can try to produce a more useful type that does not resolve to [string, unknown][].
@fabian-hiller in one of issue code blocks I saw you've used it this way, that's why I've tried the same in my project and got to this question. I didn't specify schema type before in flatten.
Since you've said there's no advantage I'd consider this resolved 🙌
p.s. It would be awesome if type was the same for schema/no schema to avoid such questions, but I'd consider this as low priority and this issue can serve as a reference
I've tried switching from
GenericSchema
toObjectSchema
, checked suggested way in other issues and passedSchema
type toflatten
. For whatever reason themessage
type isunknown
Playground example
Error messages type:
If I remove
Schema
fromflatten
the type is array of strings:Playground example
Is there a correct method that matches this types with schema defined?
valibot - 1.0.0-beta.9
The text was updated successfully, but these errors were encountered: