cancel
Showing results for 
Search instead for 
Did you mean: 

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

Contributor

"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

Screen Shot 2019-03-06 at 9.39.20 AM.pngScreen Shot 2019-03-06 at 9.37.13 AM.png

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

 

Thanks

 

6 REPLIES 6
Moderator

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

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.


Did my reply answer your question? Give Kudos or Accept it as a Solution to help others.↓↓↓↓↓
Contributor

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

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. 

Moderator

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

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.


Did my reply answer your question? Give Kudos or Accept it as a Solution to help others.↓↓↓↓↓
Contributor

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

Thanks for the link.

 

Here is my situation. I was provided our API json file by one of my teammates and it says swagger 2.0 on top. So that person probably used swagger 2.0. Now i am using that file to open in an online editor. So what do you suggest me to do going forward since I need to make changes based on 3.0 as you can see. 

 

Do I need to download anything from swagger website for 3.0 on my machine? Like I told you, I don't have access to everything, I only have this json file provided to me by my teammate and i am trying to create documentation out of it using online editor. 

Moderator

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

You don't have to convert 2.0 to 3.0.

 

You can continue using 2.0, just be aware that some 3.0 features don't exist in 2.0.

When reading the documentation, note that you can switch to the 2.0 documentation - https://swagger.io/docs/specification/2-0/basic-structure/.

 

I only suggested the conversion to 3.0 because it looked like a mix of both, but as long as you stick with the 2.0 structure, it'll work out great.


Did my reply answer your question? Give Kudos or Accept it as a Solution to help others.↓↓↓↓↓
Highlighted
Contributor

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

Thanks Ron for all your help and instant responses.

 

Appreciate this. This is very helpful.

 

Regards

 

New Here?
Join us and watch the welcome video:
Watch the new Interview