Error when running Swagger-tester for Heroku-pets example

46 views
Skip to first unread message

ujjawa...@dataweave.com

unread,
Jan 16, 2017, 1:10:10 AM1/16/17
to Swagger
Hello,

I was trying to test heroku-pets example file(http://editor.swagger.io/#/) using swagger tester. I am getting an error- 

ERROR:connexion.api:Failed to add operation for PUT /pet/

ResolverError: <ResolverError: Cannot resolve operationId "None"!>
ERROR:connexion.api:Failed to add operation for POST /pet/

ResolverError: <ResolverError: Cannot resolve operationId "None"!>
ERROR:connexion.api:Failed to add operation for GET /pet/

ResolverError: <ResolverError: Cannot resolve operationId "None"!>
ERROR:connexion.api:Failed to add operation for GET /pet/{petId}

ResolverError: <ResolverError: Cannot resolve operationId "None"!>
Starting testrun against hero.json or None using examples: True




Below is the code for my test.py file to run my configuration file for heroku-pets, which is i have saved locally in json format(config. file name- hero.json)

from swagger_tester import swagger_test

authorize_error = {
  'get': {
    '/pet/': [200,400, 404],
    '/pet/{petId}': [200,400,404],
  },
  'post': {
   '/pet/': [200,400, 404]
  },
  'put': {
  '/pet/': [200,400, 404]
  } 
}
swagger_test('hero.json', authorize_error=authorize_error)


Below is my console output when i run my test.py file:

ujjwal@ujjwal:~/Desktop/dataweave$ python test.py
ERROR:connexion.api:Failed to add operation for PUT /pet/
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/connexion/api.py", line 237, in add_paths
    self.add_operation(method, path, endpoint, path_parameters)
  File "/usr/local/lib/python2.7/dist-packages/connexion/api.py", line 189, in add_operation
    resolver=self.resolver)
  File "/usr/local/lib/python2.7/dist-packages/connexion/operation.py", line 210, in __init__
    resolution = resolver.resolve(self)
  File "/usr/local/lib/python2.7/dist-packages/connexion/resolver.py", line 39, in resolve
    return Resolution(self.resolve_function_from_operation_id(operation_id), operation_id)
  File "/usr/local/lib/python2.7/dist-packages/connexion/resolver.py", line 67, in resolve_function_from_operation_id
    raise ResolverError(msg)
ResolverError: <ResolverError: Cannot resolve operationId "None"!>
ERROR:connexion.api:Failed to add operation for POST /pet/
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/connexion/api.py", line 237, in add_paths
    self.add_operation(method, path, endpoint, path_parameters)
  File "/usr/local/lib/python2.7/dist-packages/connexion/api.py", line 189, in add_operation
    resolver=self.resolver)
  File "/usr/local/lib/python2.7/dist-packages/connexion/operation.py", line 210, in __init__
    resolution = resolver.resolve(self)
  File "/usr/local/lib/python2.7/dist-packages/connexion/resolver.py", line 39, in resolve
    return Resolution(self.resolve_function_from_operation_id(operation_id), operation_id)
  File "/usr/local/lib/python2.7/dist-packages/connexion/resolver.py", line 67, in resolve_function_from_operation_id
    raise ResolverError(msg)
ResolverError: <ResolverError: Cannot resolve operationId "None"!>
ERROR:connexion.api:Failed to add operation for GET /pet/
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/connexion/api.py", line 237, in add_paths
    self.add_operation(method, path, endpoint, path_parameters)
  File "/usr/local/lib/python2.7/dist-packages/connexion/api.py", line 189, in add_operation
    resolver=self.resolver)
  File "/usr/local/lib/python2.7/dist-packages/connexion/operation.py", line 210, in __init__
    resolution = resolver.resolve(self)
  File "/usr/local/lib/python2.7/dist-packages/connexion/resolver.py", line 39, in resolve
    return Resolution(self.resolve_function_from_operation_id(operation_id), operation_id)
  File "/usr/local/lib/python2.7/dist-packages/connexion/resolver.py", line 67, in resolve_function_from_operation_id
    raise ResolverError(msg)
ResolverError: <ResolverError: Cannot resolve operationId "None"!>
ERROR:connexion.api:Failed to add operation for GET /pet/{petId}
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/connexion/api.py", line 237, in add_paths
    self.add_operation(method, path, endpoint, path_parameters)
  File "/usr/local/lib/python2.7/dist-packages/connexion/api.py", line 189, in add_operation
    resolver=self.resolver)
  File "/usr/local/lib/python2.7/dist-packages/connexion/operation.py", line 210, in __init__
    resolution = resolver.resolve(self)
  File "/usr/local/lib/python2.7/dist-packages/connexion/resolver.py", line 39, in resolve
    return Resolution(self.resolve_function_from_operation_id(operation_id), operation_id)
  File "/usr/local/lib/python2.7/dist-packages/connexion/resolver.py", line 67, in resolve_function_from_operation_id
    raise ResolverError(msg)
ResolverError: <ResolverError: Cannot resolve operationId "None"!>
Starting testrun against hero.json or None using examples: True
INFO:swagger_tester.swagger_tester:TESTING PUT /pet/?
INFO:swagger_tester.swagger_tester:Using FlaskClient, got status code 404 for ********** PUT /pet/?
INFO:swagger_tester.swagger_tester:Got expected authorized error on /pet/? with status 404
INFO:swagger_tester.swagger_tester:TESTING POST /pet/?
INFO:swagger_tester.swagger_tester:Using FlaskClient, got status code 404 for ********** POST /pet/?
INFO:swagger_tester.swagger_tester:Got expected authorized error on /pet/? with status 404
INFO:swagger_tester.swagger_tester:TESTING GET /pet/?limit=11
INFO:swagger_tester.swagger_tester:Using FlaskClient, got status code 404 for ********** GET /pet/?limit=11
INFO:swagger_tester.swagger_tester:Got expected authorized error on /pet/?limit=11 with status 404
INFO:swagger_tester.swagger_tester:TESTING GET /pet/string?
INFO:swagger_tester.swagger_tester:Using FlaskClient, got status code 404 for ********** GET /pet/string?
INFO:swagger_tester.swagger_tester:Got expected authorized error on /pet/string? with status 404


I have installed connexion framework also. How to resolve above errors and What is the expected output for testing ? Actually, I am new to swagger and want to learn how testing is done with help of swagger tester so that i can use this in my organisation.
PFA the json file for heroku-pets example.

It would be a great help from you. Waiting for your reply.

Thanks and Regards,
Ujjawal Saini


hero.json
Reply all
Reply to author
Forward
0 new messages