These forums have been archived and are now read-only.

The new forums are live and can be found at https://forums.eveonline.com/

EVE Technology Lab

 
  • Topic is locked indefinitely.
 

Using the Bravado SwaggerClient to access ESI universe/names

First post
Author
Arxan
Strategic Exploration and Development Corp
Silent Company
#1 - 2017-01-27 19:52:44 UTC
I'm trying to use the Python Bravado SwaggerClient to access the ESI universe/names API call. It is a POST request and that might be my problem. My code looks like this...

from bravado.client import SwaggerClient
esi = SwaggerClient.from_url("https://esi.tech.ccp.is/latest/swagger.json")
print esi.Universe.post_universe_names(ids=[1,2]).result()


The result is an error from bravado_core complaining about a missing "type" key in dictionary while marshaling the parameters.

Any suggestions?
salacious necrosis
Garoun Investment Bank
Gallente Federation
#2 - 2017-01-27 22:51:01 UTC
Arxan wrote:
I'm trying to use the Python Bravado SwaggerClient to access the ESI universe/names API call. It is a POST request and that might be my problem. My code looks like this...

from bravado.client import SwaggerClient
esi = SwaggerClient.from_url("https://esi.tech.ccp.is/latest/swagger.json")
print esi.Universe.post_universe_names(ids=[1,2]).result()


The result is an error from bravado_core complaining about a missing "type" key in dictionary while marshaling the parameters.

Any suggestions?


There's a bug in CCP's spec, they failed to include "type" : "object" at the start of the schema. So bravado barfs trying to figure out the type. I'll raise an issue shortly.

Use EveKit ! - Tools for EVE Online 3rd party development

salacious necrosis
Garoun Investment Bank
Gallente Federation
#3 - 2017-01-27 23:29:24 UTC
Here's the issue for tracking:

https://github.com/ccpgames/esi-issues/issues/241

If this is urgent, you can download the spec and add "type":"object" as described in the issue. You can then load the spec from a file with code like this:


from bravado.client import SwaggerClient
from bravado.swagger_model import load_file
esi = SwaggerClient.from_spec(load_file("/path/to/your/version/swagger.json"))

Use EveKit ! - Tools for EVE Online 3rd party development

CCP SnowedIn
C C P
C C P Alliance
#4 - 2017-01-27 23:40:49 UTC
commented on the issue as well, but you can use then /dev/ or /v2/ versions to avoid this issue.

that route is scheduled to be upgraded at the end of the month (moving /dev/ to /latest/) according to https://github.com/ccpgames/esi-issues/projects/2

CCP SnowedIn // Distributed Systems Engineer // Team Tech Co // @CCP_SnowedIn

Arxan
Strategic Exploration and Development Corp
Silent Company
#5 - 2017-01-28 00:26:03 UTC
Thanks! I'll try one of those workarounds until the problem is fixed.