Include the basePath in the path in swagger output

This fixes both SPEC-393, and ORG-52.
pull/977/head
Richard van der Hoff 8 years ago
parent b0284f0c7e
commit f46a2a7f2b

@ -45,7 +45,7 @@ os.chdir(templating_dir)
apis = MatrixUnits().load_swagger_apis()
output = {
"basePath": "/_matrix/client/" + major_version,
"basePath": "/",
"consumes": ["application/json"],
"produces": ["application/json"],
"host": "localhost:8008",
@ -63,7 +63,10 @@ with open(os.path.join(api_dir, 'client-server', 'definitions',
output['securityDefinitions'] = yaml.load(f)
for file, contents in apis.items():
basePath = contents['basePath']
for path, methods in contents["paths"].items():
path = (basePath + path).replace('%CLIENT_MAJOR_VERSION%',
major_version)
for method, spec in methods.items():
if "tags" in spec.keys():
if path not in output["paths"]:
@ -71,7 +74,6 @@ for file, contents in apis.items():
output["paths"][path][method] = spec
print "Generating %s" % output_file
try:

Loading…
Cancel
Save