Identifying Error-Prone Fields in Schema Decoding Failures

Is it possible to know which field caused an error when decoding the full schema?

Example schema:
export class CreateAccountContext extends Schema.Class<CreateAccountContext>(
  "CreateAccountContext"
)({
  firstName: Schema.String.pipe(
    Schema.minLength(1),
    Schema.maxLength(4),
    Schema.brand("FirstName")
  ),
  lastName: Schema.String.pipe(Schema.minLength(1), Schema.brand("LastName")),
}) {}


I use Schema.decodeUnknownEither(Context.CreateAccountContext)

I want to know which field (firstName, lastName, or both) caused an error from the resulting ParseError, and get their error message
Was this page helpful?