在Open API 3.0(Swagger)中使用get请求创建请求正文

时间:2018-10-05 19:19:15

标签: get request swagger openapi

我有以下要求- /用户 得到:       摘要:获取用户
      operationId:getUser       description:用于基于设置的数据获取用户信息的功能

  parameters:
    - in: query
      name: firstName
      required: true
      description:firstName
      schema:
        type: string
    - in: query
      name: lastName
      required: true
      description: lastName
      schema:
        type: string
    - in: query
      name: phoneNumber
      description:phoneNumber
      schema:
        type: string
    - in: query
      name: emailId
      description: emailId
      schema:
        type: string
     - in: query
      name: companyId
      description: companyId
      schema:
        type: string
    - in: query
      name: companyCode
      description: companyCode
      schema:
        type: string
    - in: query
      name: companyName
      description: companyCode
      schema:
        type: string

有没有一种方法可以创建如下结构并使用$ ref标签-参数:         -$ ref:'#/ components / parameters / user'创建请求。就像当我尝试添加更多输入参数以键入user时,它开始抛出错误 组件:   参数:     用户:         -在:查询           名称:firstName           说明:firstName           模式:             类型:字符串            公司:         -在:查询           名称:companyId           描述:companyId           模式:             类型:字符串       

0 个答案:

没有答案