如果我有一个返回此功能的函数:
render :json => @orders.as_json(include: [{:user => {only: :id}}], :only => [:id, :status_id])
我正在记录它:
# @return [JSON] includes the id, the order status id and the id of the associated user
我想知道是否有更好的方法来记录返回的JSON的样子。
答案 0 :(得分:0)
因此,如果你关心API的文档,我认为你也关心测试,所以你的API端点可能有测试。我建议您使用Rspec API Documentation。如果您目前没有使用Rspec,我会尝试Apipie。这两个工具都有助于确保您的API文档保持一致并保持最新。