【发布时间】:2018-09-19 07:06:14
【问题描述】:
我想用 image [json] 那样的招摇来构建模型,我有类似 this 的东西。我想在块内有描述标题和数据。下面是代码:
require 'swagger_helper'
describe 'Users API' do
path '/register/first_step' do
post 'First step of Registration' do
tags 'registration'
consumes 'application/json', 'application/xml'
parameter name: :user, in: :body, schema: {
type: :object,
properties: {
first_name: {
properties:
{
type: :string,
id: :integer
}
},
}, required: [ :first_name ]
}
end
end
end
【问题讨论】:
-
你能添加一个实际用户 JSON 应该是什么样子的示例吗?
-
我上传了图片
标签: ruby-on-rails ruby api swagger-ui