Following the discussion on Elixir Forum, we should have a way to create Zoi schemas and generate different outputs such as ecto embedded schemas. Ecto will be an optional library, and if the project have it, Zoi will offer functions that will help integrating ecto schemas (for now embeds) with zoi plain schemas.
So far the API design agreed was:
defmodule Project.Inputs.OnboardUser do
require Zoi.Ecto
@schema Zoi.map(%{email: Zoi.email()})
# Macro that will create the embedded in this module
Zoi.Ecto.generate_embedded_schema(@schema)
def schema, do: @schema
end
Zoi should also provide a way to integrate with changesets. For now we agreed to convert zoi parsed results (or errors) into a changeset container but the API will be later defined
Following the discussion on Elixir Forum, we should have a way to create
Zoischemas and generate different outputs such as ecto embedded schemas.Ectowill be an optional library, and if the project have it,Zoiwill offer functions that will help integrating ecto schemas (for now embeds) with zoi plain schemas.So far the API design agreed was:
Zoishould also provide a way to integrate with changesets. For now we agreed to convert zoi parsed results (or errors) into a changeset container but the API will be later defined