Add _cs suffix to client-server http APIs

I'm about to add identity service APIs, so differentiating is good.
This commit is contained in:
Daniel Wagner-Hall 2016-03-08 17:42:41 +00:00 committed by review.rocks
parent cc0dae3aeb
commit f4f186baee
19 changed files with 48 additions and 43 deletions

View file

@ -17,7 +17,10 @@ import subprocess
import urllib
import yaml
HTTP_APIS = ("../api/application-service", "../api/client-server",)
HTTP_APIS = {
"../api/application-service": "as",
"../api/client-server": "cs",
}
EVENT_EXAMPLES = "../event-schemas/examples"
EVENT_SCHEMA = "../event-schemas/schema"
CORE_EVENT_SCHEMA = "../event-schemas/schema/core-event-schema"
@ -474,7 +477,7 @@ class MatrixUnits(Units):
def load_swagger_apis(self):
apis = {}
for path in HTTP_APIS:
for path, suffix in HTTP_APIS.items():
for filename in os.listdir(path):
if not filename.endswith(".yaml"):
continue
@ -483,6 +486,7 @@ class MatrixUnits(Units):
with open(filepath, "r") as f:
# strip .yaml
group_name = filename[:-5].replace("-", "_")
group_name = "%s_%s" % (group_name, suffix)
api = yaml.load(f.read())
api = resolve_references(filepath, api)
api["__meta"] = self._load_swagger_meta(