【发布时间】:2019-06-18 03:37:40
【问题描述】:
我将RSpec API Documentation Generator Gem 用于我的rails 应用程序,当我生成文档时,请求正文(JSON 格式)的格式如下:
{"user":{"email":"person1@example.com","password":"z5x6c7v8!@!"}}
有没有办法像下面这样漂亮地打印它?
{
"user": {
"email":"person1@example.com",
"password":"password"
}
}
我似乎找不到任何配置选项来执行此操作。我正在使用以下两个标题:
header 'Content-Type', 'application/json'
header 'Accept', 'application/json'
【问题讨论】:
标签: ruby-on-rails rspec-api-documentation