** (FunctionClauseError) no function clause matching in anonymous fn/1 in Mix.Tasks.Ash.Gen.Resource.attribute_modifier_string/1
The following arguments were given to anonymous fn/1 in Mix.Tasks.Ash.Gen.Resource.attribute_modifier_string/1:
# 1
"optional"
(ash 3.4.35) lib/mix/tasks/gen/ash.gen.resource.ex:303: anonymous fn/1 in Mix.Tasks.Ash.Gen.Resource.attribute_modifier_string/1
(elixir 1.17.2) lib/enum.ex:1804: anonymous fn/2 in Enum.map_join/3
(elixir 1.17.2) lib/enum.ex:4408: Enum.map_intersperse_list/3
(elixir 1.17.2) lib/enum.ex:1804: Enum.map_join/3
(ash 3.4.35) lib/mix/tasks/gen/ash.gen.resource.ex:290: anonymous fn/1 in Mix.Tasks.Ash.Gen.Resource.attributes/1
(elixir 1.17.2) lib/enum.ex:1804: anonymous fn/2 in Enum.map_join/3
(elixir 1.17.2) lib/enum.ex:4408: Enum.map_intersperse_list/3
(elixir 1.17.2) lib/enum.ex:1804: Enum.map_join/3
Expected behavior
Return an error response code but indicate the attribute modifier is unrecognizeable and perhaps point to the ones that are allowed.
Also, it will generate a resource with an incorrect type attribute (text in this case) which will compile error later and indicate the correct types. I think we should be able to check against that too.
Describe the bug Currently the error messages for incorrect attribute details when using
ash.gen.resources
can be a little confusing to end users.To Reproduce Run the
ash.gen.resource
generator with any attribute options that don't exist.It will output the following error message:
Expected behavior Return an error response code but indicate the attribute modifier is unrecognizeable and perhaps point to the ones that are allowed.
Also, it will generate a resource with an incorrect type attribute (
text
in this case) which will compile error later and indicate the correct types. I think we should be able to check against that too.Runtime