Solve "Invalid Swagger 2.0 input" when import swagger to AWS API

Today, 27th January 2023, Ukraine is still bravely fighting for democratic values, human rights and peace in whole world. Russians ruthlessly kill all civilians in Ukraine including childs and destroy their cities. We are uniting against Putinโ€™s invasion and violence, in support of the people in Ukraine. You can help by donating to Ukrainian's army.

1. Do not use single quotes (') when defining strings.

Wrong: { "key":'something' } 

Use double (") instead:

{ "key":"something" } 

For some reason, swagger web editor ( validates single quotes and there are many examples on the network which use it for example for defining pattern, but this will not be considered as valid on AWS:

{ "pattern": '^(\d{2})$' } 

2. Do not use unescaped backslash inside of quotes.


{ "pattern": "^(\d)$" } 


{ "pattern": "^(\\d)$" } 

Use an external JSON validator (e.g. which will give you an error on the specific position. AWS doesn't show an error reason it only says that it invalid.

Bug in the Amazon web console

If you load swagger from local file on PC to amazon web console there are some bug when you reselect file it not reloads - you need to update page (F5) before reupload

Invalid Swagger 2.0 input

Ivan Borshchov profile picture
Jan 17, 2017
by Ivan Borshchov
Did it help you?
Yes !

Best related