The Reform-3 (trailblazer-form
) section is still WIP (as of November 2023).
We’re going to announce a presentable release of R3 in public. Currently, we’re collecting doc notes here.
Form.deserialize
returns Form::Deserialized
Form::Deserialized
created in [NestedDeserializer]
generic_input = # input going into the nested "form"
->(ctx, value:, **) {
{
populated_instance: DeserializedFields.new,
form_instance: nested_form.new, # we use this as the {exec_context} for filters.
input: value,
}
}
Railway.Subprocess(nested_deserializer).merge
Railway.Out() => ->(ctx, populated_instance:, form_instance:, **) {
# FIXME: use kw for {:model_from_populator}
{
value: Form::Deserialized.new(nested_schema, form_instance, populated_instance, ctx, paired_model: ctx[:paired_model]), # this is used in {set}.
# Here we would have to return the mutated twin
}
set
populated_instance = populated_instance.merge(key => value)