Use local swagger spec files (#866)

Allows auth to keep working if CCP changes "latest" definition.
Requires adarnauth-esi>=1.4
This commit is contained in:
Adarnof
2017-09-17 01:08:02 -04:00
committed by GitHub
parent 9d90af4a3d
commit eee6a9132d
9 changed files with 24 additions and 15 deletions

View File

@@ -6,6 +6,9 @@ import json
from bravado.exception import HTTPNotFound, HTTPUnprocessableEntity
import evelink
import logging
import os
SWAGGER_SPEC_PATH = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'swagger.json')
logger = logging.getLogger(__name__)
@@ -228,7 +231,7 @@ class EveProvider(object):
@python_2_unicode_compatible
class EveSwaggerProvider(EveProvider):
def __init__(self, token=None, adapter=None):
self.client = esi_client_factory(token=token, Alliance='v2', Character='v4', Corporation='v2', Universe='v2')
self.client = esi_client_factory(token=token, spec_file=SWAGGER_SPEC_PATH)
self.adapter = adapter or self
def __str__(self):
@@ -237,7 +240,7 @@ class EveSwaggerProvider(EveProvider):
def get_alliance(self, alliance_id):
try:
data = self.client.Alliance.get_alliances_alliance_id(alliance_id=alliance_id).result()
corps = esi_client_factory(Alliance='v1').Alliance.get_alliances_alliance_id_corporations(alliance_id=alliance_id).result()
corps = self.client.Alliance.get_alliances_alliance_id_corporations(alliance_id=alliance_id).result()
model = Alliance(
self.adapter,
alliance_id,

1
eveonline/swagger.json Normal file

File diff suppressed because one or more lines are too long