我和凤凰城一起玩,但出于某种原因,我无法使用JA_Serializer。
我依赖于我的mix.exs
defp deps do
(...)
{:ja_serializer, "~> 0.11.1"},
(...)
end
我遵循了文档:
我的config.exs
config :phoenix, :format_encoders,
"json-api": Poison
config :mime, :types, %{
"application/vnd.api+json" => ["json-api"]
}
重新编译mime:
mix deps.clean mime --build
mix deps.get
但它一直都在失败:
$ mix ja_serializer.gen.phoenix_api Market markets name:string phone:string
** (Mix) The task "ja_serializer.gen.phoenix_api" could not be found