Swagger:使用 body 的 Get 方法无效也更改为查询、路径,header 仍然无效

Swagger : Get method using body is not working also changed into the query, path, header still not working

到目前为止,我正在 openapi.yaml 以及在 google 云端点上部署我的测试 API 正在工作,但现在我做了一些更改,我正在发送参数body 获取 api(例如电子邮件)并获得一些响应,但实际上在本地它在部署 openapi.yaml 文件后与邮递员一起工作正常它在 google 云终端门户

所以,任何body对此有任何解决方案或答案所以请帮助我

为了安全起见,我还分享了错误截图和代码片段

"/api/getRecords":
   get:
    description: "Get All Records Details."
    operationId: "getRecords"
    produces:
      - "application/json"    
    parameters:
    - description: "Message to getRecords"
      in: query
      name: getRecords
      type: object
      required: false
      schema:
        $ref: "#/definitions/echoMessage"         
    responses:
      200:

此外,

像这样尝试你的代码:

# [START swagger]
  swagger: "2.0"
  info:
    description: "A simple Google Cloud Endpoints API example."
    title: "Endpoints Example"
    version: "1.0.0"
  host: "abc.appspot.com"
# [END swagger]
  parameters:
    email:
      name: email
      in: query
      type: string
      required: true

然后在路径中使用shorthand语法:

path:
 "/api/getRecords":
   get:
     description: "Get All Records Details."
     operationId: "getRecords"
     parameters:
       - $ref: "#/parameters/email"
     responses:
       200:
         description: "Get records details"
         schema:
           $ref: "#/definitions/postMessage"

它会起作用。