Hello!
I have a question on why the generated code in the controller patterns match like this:
def create(conn, %{"resource" => resource_params}) do
...
end
Is it a good design decision to follow in my REST api? Or is it better to just have all the params without being nested in the "resource"
?
If the consumer of this api doesn’t send the "resource"
then a pattern match error is raised but the consumer doesn’t have enough information of what happened (missing "resource"
key), how do I overcome this?
Thank you!