Move application service swagger out of c-s dir

pull/977/head
Daniel Wagner-Hall 9 years ago
parent 8c32627751
commit 614ee9ea1b

@ -17,7 +17,7 @@ import subprocess
import urllib import urllib
import yaml import yaml
HTTP_APIS = "../api/client-server" HTTP_APIS = ("../api/application-service", "../api/client-server",)
EVENT_EXAMPLES = "../event-schemas/examples" EVENT_EXAMPLES = "../event-schemas/examples"
EVENT_SCHEMA = "../event-schemas/schema" EVENT_SCHEMA = "../event-schemas/schema"
CORE_EVENT_SCHEMA = "../event-schemas/schema/core-event-schema" CORE_EVENT_SCHEMA = "../event-schemas/schema/core-event-schema"
@ -549,20 +549,20 @@ class MatrixUnits(Units):
def load_swagger_apis(self): def load_swagger_apis(self):
apis = {} apis = {}
path = HTTP_APIS for path in HTTP_APIS:
for filename in os.listdir(path): for filename in os.listdir(path):
if not filename.endswith(".yaml"): if not filename.endswith(".yaml"):
continue continue
self.log("Reading swagger API: %s" % filename) self.log("Reading swagger API: %s" % filename)
filepath = os.path.join(path, filename) filepath = os.path.join(path, filename)
with open(filepath, "r") as f: with open(filepath, "r") as f:
# strip .yaml # strip .yaml
group_name = filename[:-5].replace("-", "_") group_name = filename[:-5].replace("-", "_")
api = yaml.load(f.read()) api = yaml.load(f.read())
api["__meta"] = self._load_swagger_meta( api["__meta"] = self._load_swagger_meta(
filepath, api, group_name filepath, api, group_name
) )
apis[group_name] = api apis[group_name] = api
return apis return apis
def load_common_event_fields(self): def load_common_event_fields(self):

Loading…
Cancel
Save