Ruby on rails 葡萄招摇过市轨道与降价
我正在rails 5.2项目中使用grape和grap-swagger rails gems。过去,每个APIRuby on rails 葡萄招摇过市轨道与降价,ruby-on-rails,swagger,Ruby On Rails,Swagger,我正在rails 5.2项目中使用grape和grap-swagger rails gems。过去,每个APIdetail字符串都支持降价。它似乎已经被移除了。提交中声明的删除它的原因是因为OAPI接受[GFM],但据我所知,这仅在API集合的总体描述中得到支持,而不是在每个API的基础上 如何使用grape/grape swagger或其他gems for Rails的组合,在每个API的基础上获得降价或其他漂亮的格式?事实证明,我遗漏了一个重要的细节。个别API的detail字符串已经在使用
detail
字符串都支持降价。它似乎已经被移除了。提交中声明的删除它的原因是因为OAPI接受[GFM],但据我所知,这仅在API集合的总体描述中得到支持,而不是在每个API的基础上
如何使用grape/grape swagger或其他gems for Rails的组合,在每个API的基础上获得降价或其他漂亮的格式?事实证明,我遗漏了一个重要的细节。个别API的
detail
字符串已经在使用GFM降价!使用herdoc
提供字符串可以获得非常好看的细节
下面是一个精心设计的示例,演示了格式良好的API可能是什么样子:
resource :planets do
desc "Get a list of the planets" do
detail <<-END
This is some nicely formatted information with a **bolded** word
- and
- some
- bullets
END
end
get :planets do
# ... code to get the planets here
end
end
资源:行星是什么
desc“获取行星列表”怎么办
细节