Effect CommunityEC
Effect Community2y ago
82 replies
Mattia Manzati

Failure in Roundtrip of Exit Schema with Void

I think I found a case where a roundtrip of an exit schema with void fails.
Its seems that it's caused by applying parseJson around, but tbh I expected the encoded version of exit to be json-safe

const testSchema = Schema.parseJson(Schema.exit(Schema.never, Schema.void))

runMain(pipe(
  Exit.unit,
  Schema.encode(testSchema),
  Effect.flatMap(Schema.decode(testSchema)) // <= fails saying that value is missing in encoded exit
))
Was this page helpful?