我想做一个招摇的端点,即请求主体是一个具有 2 个整数字段的产品对象和一个具有另外 2 个字段的选项对象,我将rswag
其用作 ruby gem
在我的规范中
parameter in: :body, schema: {
type: :object,
properties: {
product_id: { type: :integer },
quantity: { type: :integer },
options: {
properties: {
color: { type: :string },
size: { type: :string },
}
},
}
}
但是,在我的用户界面中,我没有颜色或大小字段,只有一个选项文本字段,我该如何解决这个问题?