我是Elixir / Phoenix的新手。有没有办法将Swagger文档添加到Phoenix api项目中?
我看了https://github.com/xerions/phoenix_swagger,但几个月前就已更新,并且尚未解决旧的未解决问题。
这是另一个问题https://github.com/OpenAperture/swaggerdoc。
或者我应该将Maru用于api项目吗?
答案 0 :(得分:0)
两个项目都会获得更新。 SwaggerDoc提供了Ecto支持,但Build状态已经失败了两个月。
PhoenixSwagger不是,但取决于扩展控制器(您可以使用它来自己实现Ecto支持)。此外,它似乎也在积极维持。
答案 1 :(得分:0)
我们正在积极维护https://github.com/everydayhero/phoenix_swagger附加功能
defmodule MyApp.UserController do
use MyApp.Web, :controller
import PhoenixSwagger
swagger_path :index do
get "/users"
summary "Get users"
description "Get all users"
response 200, "Success", :Users
tag "users"
end