goal icon indicating copy to clipboard operation
goal copied to clipboard

Error on Nested schema with inputs_for

Open lillo42 opened this issue 11 months ago • 1 comments

Hello, when I use the nested schema with inputs_for I'm getting an exceptions

my scheam

defparams :new do
    required :uuid, :string, format: :uuid
    required :name, :string, min: 3, max: 3
    optional :age, :integer, min: 0, max: 120
    optional :gender, :enum, values: ["female", "male", "non-binary"]

    optional :data, :map do
      required :color, :string
      optional :money, :decimal
      optional :height, :float
    end
  end
<.simple_form for={@form}>
   <.inputs_for :let={data} field={@form[:data]}></.inputs_for>
</.simple_form>

The errors:

key :__struct__ not found in: %{}

Screenshot 2025-01-12 at 01 06 28

lillo42 avatar Jan 12 '25 01:01 lillo42

@martinthenth is goal missing some kind of protocol implementation? Or should the goal approach change to create structs for defparams? 🤔

nelsonmestevao avatar May 26 '25 16:05 nelsonmestevao