We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I want to be able to declare the following contract required(:key) => %SomeStruct{} on a drop.
required(:key) => %SomeStruct{}
It doesn't seem possible to achieve this, even when using custom types, or am I missing something?
Full example:
defmodule MyApp.APIContract do use Drops.Contract alias MyApp.WhateverStruct @enforce_keys [:context, :action] defstruct @enforce_keys schema do %{ required(:context) => %WhateverStruct{}, required(:action) => string(:filled?), } end def new(attrs) when is_map(attrs) do case conform(attrs) do {:ok, attrs} -> struct(__MODULE__, attrs) error -> error end end end
The text was updated successfully, but these errors were encountered:
Thanks for reporting the issue! This will be supported eventually 😄
Sorry, something went wrong.
No branches or pull requests
I want to be able to declare the following contract
required(:key) => %SomeStruct{}
on a drop.It doesn't seem possible to achieve this, even when using custom types, or am I missing something?
Full example:
The text was updated successfully, but these errors were encountered: