Merge pull request #329 from matrix-org/rav/basepath_in_swagger
Include the basePath in the path in swagger output
This commit is contained in:
commit
d1fd9de10e
1 changed files with 4 additions and 2 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue