1

I'm trying to connect to BitMEX using Swagger. I've written the following integration with Bravado, but I keep getting errors, no matter what I do.

from bravado.client import SwaggerClient

client = SwaggerClient.from_url('https://www.bitmex.com/api/explorer/swagger.json',
                                config={'validate_swagger_spec': False, 'validate_responses':False, 'also_return_response':True, 'use_models': False})

client.Quote.Quote_get(symbol='XBTH17').result()

With all the validations disabled, this throws the following error:

SwaggerMappingError: The following schema object is missing a type field: {'additionalProperties': False, 'properties': {'foreignNotional': {'type': 'number', 'format': 'double'}, 'size': {'type': 'number', 'format': 'int64'}, 'trdMatchID': {'type': 'string', 'format': 'guid'}, 'tickDirection': {'type': 'string'}, 'side': {'type': 'string'}, 'homeNotional': {'type': 'number', 'format': 'double'}, 'timestamp': {'type': 'string', 'format': 'date'}, 'grossValue': {'type': 'number', 'format': 'int64'}, 'price': {'type': 'number', 'format': 'double'}, 'symbol': {'type': 'string'}}, 'required': ['timestamp', 'symbol']}

What am I doing wrong?

cjm2671
  • 18,348
  • 31
  • 102
  • 161

0 Answers0