Skip to content

Error creating SwaggerClient #6

@jonocodes

Description

@jonocodes

Here is my code:

from swaggerpy.client import SwaggerClient
from swaggerpy.http_client import SynchronousHttpClient
http_client = SynchronousHttpClient()

client = ari = SwaggerClient("http://petstore.swagger.wordnik.com/api/api-docs",http_client=http_client)

Here is the error:

  File "/home/jfinger/Desktop/swagger-py/swaggerpy/client.py", line 178, in __init__
    self.api_docs = loader.load_resource_listing(url_or_resource)
  File "/home/jfinger/Desktop/swagger-py/swaggerpy/swagger_model.py", line 170, in load_resource_listing
    self.load_api_declaration(base_url, api)
  File "/home/jfinger/Desktop/swagger-py/swaggerpy/swagger_model.py", line 187, in load_api_declaration
    api_dict['url'] = urlparse.urljoin(base_url + '/', path.strip('/'))
TypeError: unsupported operand type(s) for +: 'NoneType' and 'str'

Looks like this is because the loader is looking for something called 'basePath' in the Json.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions