Swagger嵌套参数对象

时间:2020-10-21 13:31:48

标签: ruby-on-rails ruby swagger rswag

我想做出一个夸张的终结点,即请求主体是具有2个整数字段的产品对象和具有2个以上字段的选项对象,我将rswag用作红宝石

按照我的规范

      parameter in: :body, schema: {
        type: :object,
        properties: {
            product_id: { type: :integer },
            quantity: { type: :integer },
            options: {
                properties: {
                  color: { type: :string },
                  size: { type: :string },
                }
            },
          }
      }

但是,在我的用户界面中,我没有颜色或大小的字段,只有选项的文本字段,我该如何解决?

0 个答案:

没有答案
相关问题