Open 23Skidoo opened 2 years ago
For example, given the following struct definition:
typed_struct enforce: true do field :foo, String.t() end
Spect will happily accept an empty map as valid:
> Spect.to_spec(%{}, __MODULE__) {:ok, %__MODULE__{foo: nil}}
"Extra" fields being present also don't result in an error:
> Spect.to_spec(%{bar: "baz"}, __MODULE__) {:ok, %__MODULE__{foo: nil}}
For example, given the following struct definition:
Spect will happily accept an empty map as valid: