Include the basePath in the path in swagger output
This fixes both SPEC-393, and ORG-52.
This commit is contained in:
parent
b0284f0c7e
commit
f46a2a7f2b
1 changed files with 4 additions and 2 deletions
|
@ -45,7 +45,7 @@ os.chdir(templating_dir)
|
||||||
apis = MatrixUnits().load_swagger_apis()
|
apis = MatrixUnits().load_swagger_apis()
|
||||||
|
|
||||||
output = {
|
output = {
|
||||||
"basePath": "/_matrix/client/" + major_version,
|
"basePath": "/",
|
||||||
"consumes": ["application/json"],
|
"consumes": ["application/json"],
|
||||||
"produces": ["application/json"],
|
"produces": ["application/json"],
|
||||||
"host": "localhost:8008",
|
"host": "localhost:8008",
|
||||||
|
@ -63,7 +63,10 @@ with open(os.path.join(api_dir, 'client-server', 'definitions',
|
||||||
output['securityDefinitions'] = yaml.load(f)
|
output['securityDefinitions'] = yaml.load(f)
|
||||||
|
|
||||||
for file, contents in apis.items():
|
for file, contents in apis.items():
|
||||||
|
basePath = contents['basePath']
|
||||||
for path, methods in contents["paths"].items():
|
for path, methods in contents["paths"].items():
|
||||||
|
path = (basePath + path).replace('%CLIENT_MAJOR_VERSION%',
|
||||||
|
major_version)
|
||||||
for method, spec in methods.items():
|
for method, spec in methods.items():
|
||||||
if "tags" in spec.keys():
|
if "tags" in spec.keys():
|
||||||
if path not in output["paths"]:
|
if path not in output["paths"]:
|
||||||
|
@ -71,7 +74,6 @@ for file, contents in apis.items():
|
||||||
output["paths"][path][method] = spec
|
output["paths"][path][method] = spec
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
print "Generating %s" % output_file
|
print "Generating %s" % output_file
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue