【问题标题】:Is it possible to specify swagger consumes to any?是否可以指定任何招摇消费?
【发布时间】:2019-01-11 12:02:02
【问题描述】:

标题包含了我的全部问题。当端点接受任何类型时,如何在 swagger 中指定消费属性。

例如,这里是OneDrive simple file upload

【问题讨论】:

    标签: swagger


    【解决方案1】:

    application/octet-steamgeneral MIME type,意思是“未知的二进制数据”。

    consumes:
      - application/octet-stream
    


    同样,如果服务器可以返回任何 MIME 类型,您可以使用通配符 MIME 类型*/* 来表示produces

    produces:
      - '*/*'
    
    # This corresponds to the request header:
    # Accept: */*
    

    【讨论】:

      猜你喜欢
      • 2017-04-16
      • 2021-11-10
      • 2016-04-09
      • 2019-04-01
      • 1970-01-01
      • 2016-08-30
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多