summaryrefslogtreecommitdiffstats
path: root/src/pybind/mgr/dashboard/controllers/docs.py
diff options
context:
space:
mode:
authorAashish Sharma <aashishsharma@localhost.localdomain>2020-07-29 13:48:21 +0200
committerAashish Sharma <aashishsharma@localhost.localdomain>2020-08-17 18:51:34 +0200
commit830f295ebb2dac60bfc0344d1697f1926933bc42 (patch)
tree9327cc3cee176f0c50cd4807746ad82d97029888 /src/pybind/mgr/dashboard/controllers/docs.py
parentMerge pull request #36605 from rhcs-dashboard/fix-46920-master (diff)
downloadceph-830f295ebb2dac60bfc0344d1697f1926933bc42.tar.xz
ceph-830f295ebb2dac60bfc0344d1697f1926933bc42.zip
mgr/dashboard: Placeholders for Documenting REST API
Added summary/description and example value for one endpoint from each component in Rest API Documentation Fixes:https://tracker.ceph.com/issues/40767 Signed-off-by: Aashish Sharma <aasharma@redhat.com>
Diffstat (limited to 'src/pybind/mgr/dashboard/controllers/docs.py')
-rw-r--r--src/pybind/mgr/dashboard/controllers/docs.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/pybind/mgr/dashboard/controllers/docs.py b/src/pybind/mgr/dashboard/controllers/docs.py
index 84de247010c..fce5341193c 100644
--- a/src/pybind/mgr/dashboard/controllers/docs.py
+++ b/src/pybind/mgr/dashboard/controllers/docs.py
@@ -254,6 +254,7 @@ class Docs(BaseController):
@classmethod
def _gen_paths(cls, all_endpoints):
+ # pylint: disable=R0912
method_order = ['get', 'post', 'put', 'delete']
paths = {}
for path, endpoints in sorted(list(ENDPOINT_MAP.items()),
@@ -305,6 +306,13 @@ class Docs(BaseController):
'application/json': {
'schema': cls._gen_schema_for_content(body_params)}}}
+ if endpoint.query_params:
+ query_params = cls._add_param_info(endpoint.query_params, p_info)
+ methods[method.lower()]['requestBody'] = {
+ 'content': {
+ 'application/json': {
+ 'schema': cls._gen_schema_for_content(query_params)}}}
+
if endpoint.is_secure:
methods[method.lower()]['security'] = [{'jwt': []}]