Vasilis Mouratidis
Vasilis Mouratidis

Reputation: 11

Parser error "bad indentation of a mapping entry" in Swagger Editor

In the OpenAPI definition below, the parameter definition causes the parser error "bad indentation of a mapping entry". What is wrong?

paths:
  /users/{username}:
    get:
      tags:
        - users
      summary: "Get the users profile"
      parameters:
       -in: path
        name: username  
        description: "get user by name"
        type: string
        required: true
      responses:
        200:
          description: OK
          schema:
            $ref: "#/definitions/users"

Upvotes: 1

Views: 16025

Answers (1)

Helen
Helen

Reputation: 97737

In YAML sequences (lists), whitespace is required after the - indicator. You need to replace

-in: path

with

- in: path

(and align the subsequent keywords appropriately).

Upvotes: 1

Related Questions