Forum Discussion

mewalig's avatar
mewalig
New Contributor
5 years ago
Solved

POST example from documentation fails to validate at https://editor.swagger.io/

Hi,

 

The following link contains an example at the bottom, that starts with "openapi: 3.0.0".

https://swagger.io/docs/specification/describing-request-body/

 

If I paste that example into https://editor.swagger.io/, why is it throwing an error at line 8? If that's normal or correct, how is the documented example supposed to be used?

 

  • Hi mewalig,

     

    I have fixed the example in the docs - the error was that the "servers" definition was missing the "url" key:

    # Incorrect
    servers:
      - https://hooks.slack.com
    
    # Correct
    servers:
      - url: https://hooks.slack.com

    The GitHub repository is the recommended place to report issues with swagger.io docs, but we monitor this forum as well.

     

    Thanks!

2 Replies

    • HKosova's avatar
      HKosova
      SmartBear Alumni (Retired)

      Hi mewalig,

       

      I have fixed the example in the docs - the error was that the "servers" definition was missing the "url" key:

      # Incorrect
      servers:
        - https://hooks.slack.com
      
      # Correct
      servers:
        - url: https://hooks.slack.com

      The GitHub repository is the recommended place to report issues with swagger.io docs, but we monitor this forum as well.

       

      Thanks!