Swagger:同一路径下的多个动词在编辑器中验证,但阻止它重新启动

Swagger: multiple verbs under same path validates in editor, but prevents it from restarting

我有下面的 swagger 定义。编辑器验证它,PUT 和 PATCH 都显示在预览中 window。

但是,如果我随后停止编辑器并尝试重新启动它,我会得到:
错误:
{ [YAMLException: duplicated mapping key at line 128, column 53: ... -controller: messagesPatchOrSend

第 128 行是 "patch:"

正上方的行

YAML:

    paths:
      /messages/{messageId}:
        x-swagger-router-controller: messagesUpdateOrSend
        put:
          summary: Update/send a message
          description: The `PUT` method should be used where it is desireable to submitting every property whether it changed or not (as opposed to updating discrete properties of a message).  This endpoint MUST NOT be called if a `messageId` is not available. If `send=false` the message MUST be saved as a draft, otherwise the message MUST be marked for delivery.
          operationId: messagesUpdateOrSend
          consumes: ["application/json"]
          produces: ["application/json"]
          parameters:
            - name: messageId
              in: path
              description: A UID used by the proxy to uniquely identify the message.
              required: true
              type: string
            - name: send
              in: query
              description: Send message if `query=true`, save as draft if `query=false`
              required: true
              type: boolean
            - name: token
              in: query
              description: auth token, if not included in header.  Example `token=[Token]`
              required: false
              type: string
            - name: body
              in: body
              description: ""
              required: true
              schema:
                type: object
          responses:
            "200":
              description: Success/OK
              schema:
                $ref: "#/definitions/SuccessResponse"
            default:
              description: Error
              schema:
                $ref: "#/definitions/ErrorResponse"
        x-swagger-router-controller: messagesPatchOrSend
        patch:
          summary: Update/send a message
          description: ""
          operationId: messagesPatchOrSend
          consumes: ["application/json"]
          produces: ["application/json"]
          parameters:
            - name: messageId
              in: path
              required: true
              type: string
            - name: send
              in: query
              required: true
              type: boolean
            - name: token
              in: query
              required: false
              type: string
            - name: body
              in: body
              required: true
              schema:
                type: object
          responses:
            "200":
              description: Success/OK
              schema:
                $ref: "#/definitions/SuccessResponse"
            default:
              description: Error
              schema:
                $ref: "#/definitions/ErrorResponse"
        x-swagger-router-controller: messagesDelete

definitions:
  SuccessResponse:
    required:
      - message
    properties:
      message:
        type: string


  ErrorResponse:
    required:
      - message
    properties:
      message:
        type: string

这是因为 /messages/{messageId}: 中有两个 x-swagger-router-controller 值。