paths./crash/{crashId}/.post.parameters[0] 处的模式错误不完全来自 <#/definitions/parameter>,<#/definit



我试图使用swagger编辑器创建我的API定义。我已经查看了招摇规范和宠物店示例,但是当我创建我的一个端点时,我不断收到此错误:

   Schema error at paths./crash/{crashId}/.post.parameters[0]
   is not exactly one from <#/definitions/parameter>,
   <#/definitions/jsonReference>
   Schema error at paths./crash/{crashId}/.post.parameters[1]
   is not exactly one from <#/definitions/parameter>,
   <#/definitions/jsonReference>

这是错误起源的yaml:

  /crash/{crashId}/:
post:
  tags:
    - crash
  summary: Adds a feedback report
  description: Can add a feedback report with or without a crash
  consumes:
    - application/json
  produces:
    - application/json
  parameters:
    - name: crashId
      in: path
      description: the crash id parameter that this feedback report should 
  connect to
      required: false
      type: integer
      format: int32
    - name: feedbackreport
      in: body
      description: the feedbackreport
      require: true
      schema:
        $ref: '#/definitions/NewFeedbackReport'
  responses:
    '200':
      description: OK

预览仍然运行良好,当我将其放入我的招摇 UI 中时,它看起来就像我想要的那样。

怎么了?我可以忽略这一点吗?

1(路径参数(in: path(必须有required: true,因为它们总是必需的。

2( 在 body 参数中,将require更改为 required

最新更新