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:
parent
cc0dae3aeb
commit
f4f186baee
19 changed files with 48 additions and 43 deletions
|
@ -57,7 +57,7 @@ class MatrixSections(Sections):
|
|||
rest = [
|
||||
e for e in http_api["endpoints"] if e not in sorted_endpoints
|
||||
]
|
||||
endpoints = sorted_endpoints + rest
|
||||
endpoints = sorted_endpoints + sorted(rest, key=lambda k: k["path"])
|
||||
else:
|
||||
# guess it's a func, call it.
|
||||
endpoints = sortFnOrPathList(http_api["endpoints"])
|
||||
|
@ -81,9 +81,9 @@ class MatrixSections(Sections):
|
|||
renders = {}
|
||||
for group in swagger_groups:
|
||||
sortFnOrPathList = None
|
||||
if group == "presence":
|
||||
if group == "presence_cs":
|
||||
sortFnOrPathList = ["status"]
|
||||
elif group == "profile":
|
||||
elif group == "profile_cs":
|
||||
sortFnOrPathList=["displayname", "avatar_url"]
|
||||
renders[group + "_http_api"] = self._render_http_api_group(
|
||||
group, sortFnOrPathList
|
||||
|
|
|
@ -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(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue