Issue with `S.Record` and Transformed Keys in `effect/Schema`

So is it mean to be that effect/Schema:s S.Record doesn't support keys that use transforms?

Playground: https://effect.website/play/#668d89fa6758

Minimal repro, as you can see, using key of StringWithTransform causes weird error.

import { NodeRuntime } from "@effect/platform-node"
import { Effect, ParseResult } from "effect"
import { DevToolsLive } from "./DevTools"

import * as S from "effect/Schema"

export const StringWithTransform = S.transformOrFail(
  S.String,
  S.String,
  {
    strict: true,
    decode: (input, _, ast) => {
      return ParseResult.succeed(input)
    },
    encode: (input) => ParseResult.succeed(input)
  }
)

const ConfigSchema = S.Struct({
  config: S.Record({
    key: StringWithTransform,
    value: S.Record({
      key: S.String,
      value: S.Any
    })
  })
})


Error:

Error: Unsupported key schema
schema (Transformation): (string <-> string)
Was this page helpful?