Trax-air / swagger-tester

Automatically test your swagger API
MIT License
104 stars 36 forks source link

Get 404 responses when testing local petstore APIs #20

Closed YoooFeng closed 8 years ago

YoooFeng commented 8 years ago

Hi! I'm trying to use swagger_tester to validate my swagger spec. But when i tested local petstore APIs(downloaded from http://petstore.swagger.io/v2/swagger.json), i got 404 responses. In the case of online petstore APIs i got 200 responses. What i mean is i got different responses when testing the same APIs online and locally. What's the problem? Any help is much appreciated.

My code: swagger_test(swagger_yaml_path='./input/swagger-petstore.yaml') in python 2.7 win10.

cyprieng commented 8 years ago

When you use swagger_test with a path to a swagger.yaml file you also need to have the implementation of the API (the python file used by connexion). See connexion doc for more details.

If you don't use connexion, you should start your api server and give the url to swagger_test.

YoooFeng commented 8 years ago

Thank you for your response. I think i should understand how connexion works first, I will have a try!