Forum Discussion

cricketics's avatar
cricketics
Contributor
6 years ago

"Should not have additional property" error even though I am following the example

Hello everyone, i am trying to add schema and I keep getting error that I have additional property even though I am following the pattern which has been shown here on the website

https://swagger.io/docs/specification/adding-examples/

I am trying to add schema the following way as shown here on swagger site

The 2nd picture shows my error. Can you please tell me why I am getting error and how to fix it.

 

Thanks

 

6 Replies

  • Is it possible you're using Swagger 2.0? The example you shared is for OpenAPI 3, but the rest of the content of the definition you shared suggests it's Swagger 2.0.

    • cricketics's avatar
      cricketics
      Contributor

      wow, that does make sense. How do I update to latest swagger.

       

      And also can you tell me one more thing. Can we add like a text box in our description. I am trying to show an example of a json file content and want it to stand out. So is there a way to add a text box as such which stands out like a schema conent. 

       

       

      Thanks. 

      • RonRatovsky's avatar
        RonRatovsky
        Moderator

        You can use https://converter.swagger.io to convert from 2.0 to 3.0. We're hoping to have that integrated into the editor soon.

         

        As for description fields - they support markdown, so they can be styled however you wish.