Ā© 2026 Hedgehog Software, LLC
Twitter
GitHub
Discord
System
Light
Dark
More
Communities
Docs
About
Terms
Privacy
Search
Star
Feedback
Setup for Free
Decoding a JSON object with unknown keys using Schema - Effect Community
EC
Effect Community
ā¢
2y ago
ā¢
33 replies
jelderš¦¾
Decoding a JSON object with unknown keys using Schema
I
'd like to use Schema to decode a JSON object that pretty much looks like this type
:
type Rec<T> = {
[k: string]: T | undefined
}
type Rec<T> = {
[k: string]: T | undefined
}
Importantly
, we only know that they values are strings
. We don
't know that any key actually exists
. I tried using
Schema.Record
Schema.Record
, but that type is more like
"every possible string in the universe is in this object
" which isn
't terribly helpful
.
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
Question about decoding unknown JSON schema
EC
Effect Community / schema
9mo ago
Decoding Nested Object with Schema Transformation
EC
Effect Community / schema
2y ago
Creating a Schema for Omitting Type Keys with Schematics
EC
Effect Community / schema
2y ago
Decoding from unknown
EC
Effect Community / schema
3y ago