Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does the "bad indentation of mapping entry" error mean in Swagger Editor?

I'm getting the "bad indentation of mapping entry" error in the Swagger Editor for the OpenAPI definition below. Can anyone tell what's wrong with the code below?

      responses:
        '200':
          description: List all applicable errors for API
          headers:
            x-request-received-at:
              type: string
              description: A datetime stamp of when the request was received
            x-response-sent-at:
              type: string
              description: A datetime stamp of when the response was sent
          schema:
            $ref: '#/definitions/ErrorResponse'
        default:
          description: An unexpected error occurred
          schema:
            $ref: '#/definitions/Error'
   '/funeral/{contractReference}/agreement':
     get:
        summary: Get the funeral policy and debit order mandate agreement for the client to sign
        operationId: 
         - get801FuneralCoverPlanAgreementHtml
         - getAUTHORITYANDMANDATEFORPAYMENTINSTRUCTIONSHTML
        tags:
         - "FuneralCoverService"
         - "InternalAPI"
        parameters:
         - name: contractReference
        in: "path"
        required: true
        type: string
        description: "Unique contract reference linked to the quote and estimate prepared for the client which should be used as input to the agreements."
        maxLength: 80

Swagger Editor: bad indentation of mapping entry error

like image 988
Lee Adams Avatar asked Dec 11 '25 07:12

Lee Adams


1 Answers

Parameter attributes are misaligned. All attributes must have the same indentation level.

Wrong:

        parameters:
         - name: contractReference
        in: "path"
        required: true
        type: string
        description: "Unique contract reference linked to the quote and estimate prepared for the client which should be used as input to the agreements."
        maxLength: 80

Correct:

        parameters:
         - name: contractReference
           in: "path"
           required: true
           type: string
           description: "Unique contract reference linked to the quote and estimate prepared for the client which should be used as input to the agreements."
           maxLength: 80
like image 160
Helen Avatar answered Dec 14 '25 10:12

Helen



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!