Effect CommunityEC
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
}

Importantly, we only know that they values are strings. We don't know that any key actually exists. I tried using Schema.Record, but that type is more like "every possible string in the universe is in this object" which isn't terribly helpful.
Was this page helpful?