如何在Swagger中添加文件上传字段

时间:2019-04-15 09:01:49

标签: swagger swagger-editor swagger-3.0

我正试图用招摇的方式指定文件输入。

ImportUser:

  properties:
    user_type_id:
      description: ID of the related user type
      type: integer
      format: int32
      example: '1'
      nullable: false
    csv_file:
      description: CSV file
      type: **file**
    skip_first_row:
      description: Identify whether first row should be skipped
      type: string
      format: unique
      maxLength: 100
      minLength: 1
      example: '1'
      nullable: false
  type: object

文件上传按钮显示在编辑器中,但出现以下错误:

  

结构错误   components.schemas.ImportOperatorDevice.properties.csv_file.type   应该等于允许的值之一allowedValues:数组,   布尔值,整数,数字,对象,字符串

0 个答案:

没有答案