Skip to content

[PPX] @s.nullable does not get applied on optional fields #161

@tsnobip

Description

@tsnobip

I've just realized that if you have the following type:

@schema
type t = {
  foo?: @s.nullable string,
}

sury-ppx will generate:

let schema = S.schema(s => ({
  foo: s.m(S.option(S.string))
}));

I would have expected:

let schema = S.schema(s => ({
  foo: s.m(S.option(S.nullableAsOption(S.string)))
}));

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions