Closed ciokan closed 1 month ago
There are no bugs, in appRouter2
you are using Schema.encode
and the encoding side of SelectStatusPageSchema
is { readonly description?: string | null; }
:
import { Schema } from "effect"
class StatusPage extends Schema.Class<StatusPage>("StatusPage")({
id: Schema.String.pipe(Schema.nonEmptyString()),
description: Schema.optionalWith(
Schema.String.pipe(Schema.nonEmptyString()),
{ exact: true, nullable: true }
)
}) {}
const SelectStatusPageSchema = Schema.Struct(StatusPage.fields).pick("description")
/*
const plainSchema: Schema.Schema<{
readonly description?: string;
}, {
readonly description?: string | null;
}, never>
*/
const plainSchema = Schema.asSchema(SelectStatusPageSchema)
What version of Effect is running?
3.9.2
What steps can reproduce the bug?
Playground: https://effect.website/play#29f8ed0cac13
In short: it seems that the derived schema using pick has different field properties from the original
What is the expected behavior?
No response
What do you see instead?
No response
Additional information
No response