© 2026 Hedgehog Software, LLC
Twitter
GitHub
Discord
System
Light
Dark
More
Communities
Docs
About
Terms
Privacy
Search
Star
Feedback
Setup for Free
Trouble with Default Values and Optional Types in VariantSchema - Effect Community
EC
Effect Community
•
4mo ago
•
8 replies
Jakob Kruse
Trouble with Default Values and Optional Types in VariantSchema
Hey
, I
'm having trouble getting default values to work with
(and without
) VariantSchema
. I expected having a
Schema.optionalWith(...)
Schema.optionalWith(...)
also make the type optional
, but it does not
. Is it a difference between
Schema.Struct
Schema.Struct
and
Schema.Class
Schema.Class
?
I created a
Demo Playground
that hopefully illustrates my issue
.
Effect Community
Join
Production-grade applications in TypeScript.
6,221
Members
View on Discord
Resources
ModelContextProtocol
ModelContextProtocol
MCP Server
Recent Announcements
Similar Threads
Was this page helpful?
Yes
No
Similar Threads
Handling `null | undefined` values in optional fields of a struct and replacing them with a default
EC
Effect Community / schema
3y ago
Setting Default Values for Optional Fields Based on Context
EC
Effect Community / schema
2y ago
Maintaining Optional Type with Default Value in TypeScript
EC
Effect Community / schema
3y ago
Issue with Using Standard Schema and Default Values in TypeScript
EC
Effect Community / schema
5mo ago