0

私は以下の闊歩定義を持っています。エディターがそれを検証し、PUT と PATCH の両方がプレビュー ウィンドウに表示されます。

ただし、その後エディターを停止して再起動しようとすると、
エラー: エラー:
{ [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
4

1 に答える 1

1

x-swagger-router-controller内部に 2 つの値があるためです/messages/{messageId}:

于 2016-03-14T17:47:41.633 に答える