Closed pzingg closed 2 years ago
Could you please provide a minimal working example? I just tried the following locally:
defmodule MySystem do
use Boundary,
deps: [Phoenix.Param],
type: :strict
end
defmodule MySystem.MySchema do
@derive {Phoenix.Param, :param_key}
end
And this works as expected: the code above emits no warnings (unless the dep to param is removed).
If I use type: :strict
it only gets worse.
Here's the example: https://github.com/pzingg/boundary_mwp
Boundary 0.8 Phoenix 1.6 Elixir 1.12
Thanks! This was a bug in boundary. I've pushed a fix to the branch fix-dep-to-protocol-impl
. Could you please give it a try?
That branch works fine now in my original project, with or without type: :strict
.
This is now pushed to hex in version 0.9.0
When using the
@derive {Phoenix.Param, :param_key}
macro to implement the Phoenix.Param protocol for an Ecto.Schema module inside a top-levelMySystemSchemas
boundary module, I get this boundary compile-time warning:Here's the boundary definition in the
MySystemSchemas
top-level module. I could not addPhoenix.Param.Any
to the list of deps.The workaround is to actually write out the
defimpl Phoenix.Param
instead of using the@derive
macro. But I'm hoping there's a solution that would let me use the macro.