0

尝试提交带有多个附件(文件)的表单,无论它是正确的方法还是我不知道我是否使用 multipart/form-data 无法提交 json 数据。

路径:/request/create:post:tags:-请求服务API摘要:请求媒体文件访问安全性:[] operationId:createMediaRequest参数:-名称:userId in:标头描述:用户登录ID:true schema:类型:字符串 - 名称:xt-trace-id in:标头描述:请求跟踪 id 要求:true 架构:类型:字符串

  requestBody:
    description: to send a request to get media file, id is mandatory for make a request. Id should be a valid and in the form of UUID.
    content:
      application/json:
        schema:
          type: object
          properties:
            deviceinfo:
              type: array
              items:
                $ref: '#/components/schemas/ClientReqData'
            priority:
              type: string
              example: '1'
            appID:
              type: string
              example: 'app1'
            hostID:
              type: string
              example: 'host1'
            subscribers:
              type: string
              example: "[XT123,xt234]"
            requestreason:
              type: string
              example: "audit purpose"
            previousshiftemployee:
              type: string
              example: xyz
            regulationchecklist:
              type: string
              example: "[i have read instructions, I have identified]"
            file:
              type: array
              items:
                type: string
                format: binary
            attachments:
              type: array
              items:
                $ref: '#/components/schemas/Attachments'      
    required: true
    
    
  responses:
    201:
      description: Request for media created
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/CreateMediaResponse'
    400:
      $ref: '#/components/responses/400-bad-request'
    500:
      $ref: '#/components/responses/500-internal-server-error'
    503:
      $ref: '#/components/responses/503-Service-unavailable'

和附件是

Attachments:
  type: object
  properties:
    filename:
      type: string
      format: binary
4

1 回答 1

0

我了解您想为 Swagger 规范中定义的 HTTP 端点创建一个存根。换句话说,您正在寻找创建一个在线测试替身。

您有几个选择:

于 2021-07-01T13:44:02.907 回答