Ask a Question

Swagger error - should have only three digit status codes

exploit
New Contributor

Swagger error - should have only three digit status codes

I am building a Swagger documentation for an API in Swagger Editor and I have this error :

 

should only have three-digit status codes, `default`, and vendor extensions (`x-*`) as properties

This is the swagger code:

/stareMesaj:
    post:
      tags:
        - Metode disponibile
      summary: Stare mesaj
      description: Call de upload mesaj. More soon.
      operationId: stareMesaj
      responses:
        '200':
          description: 1.Ultimele 60 zile -  Nu aveti drept de interogare stare pentru
            mesaj/ 2.Mai mult de 60 zile -  Formularul cu id de incarcare= xxx a
            fost depus de mai mult de 60 de zile 3. Id maxim -  Nu aveti drept
            de interogare stare pentru mesaj= max id
          headers:
        X-Rate-Limit:
          description: calls per hour allowed by the user
          schema:
            type: integer
            format: int32

The error appears on this line :

responses:

Just before '200'

What might be the problem ? The status code is obviously three digit code

Thanks

1 REPLY 1
HKosova
SmartBear Alumni (Retired)

This is an indentation issue. X-Rate-Limit needs to be indented to the right of headers:

      responses:
        '200':
          description: ...
          headers:
            X-Rate-Limit:
              description: calls per hour allowed by the user
              schema:
                type: integer
                format: int32 

 

If you use a mix of tabs and spaces for indentation, change all tabs to spaces to avoid indentation issues.


Helen Kosova
SmartBear Documentation Team Lead
________________________
Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
cancel
Showing results for 
Search instead for 
Did you mean: