cancel
Showing results for 
Search instead for 
Did you mean: 

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

SOLVED
Highlighted
New Contributor

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?x.png

 

1 ACCEPTED SOLUTION

Accepted Solutions
Moderator

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

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!


Helen Kosova
SmartBear Technical Writer
________________________

 Join SmartBear Connect next April in Boston to meet with software development, API and testing experts from around the world! Get your ticket today!

View solution in original post

2 REPLIES 2
Highlighted
New Contributor

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

Not sure if this was the right forum, so posted also/instead at https://github.com/swagger-api/swagger.io/issues/269

Moderator

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

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!


Helen Kosova
SmartBear Technical Writer
________________________

 Join SmartBear Connect next April in Boston to meet with software development, API and testing experts from around the world! Get your ticket today!

View solution in original post