]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
doc: silence warnings from openapi sphinx extension
authorKefu Chai <kchai@redhat.com>
Mon, 1 Feb 2021 09:53:27 +0000 (17:53 +0800)
committerKefu Chai <kchai@redhat.com>
Mon, 1 Feb 2021 09:57:57 +0000 (17:57 +0800)
it prints out

skipping non-JSON example generation.

if an API does not contains example while ":example:" is specified for
openapi extension, and if this API is not a GET request, openapi
extention complains.

see also
https://github.com/sphinx-contrib/openapi/blob/9dbae9c9a65291c44b27041c63ded1b20611a2fc/sphinxcontrib/openapi/openapi30.py#L191

Signed-off-by: Kefu Chai <kchai@redhat.com>
doc/conf.py

index 8ba08573ae7d2db7041539afb95e000e8cbd761e..4dc4b81c438770d16ba6bca45ee363e10b50a6bd 100644 (file)
@@ -1,4 +1,5 @@
 import fileinput
+import logging
 import os
 import shutil
 import sys
@@ -213,6 +214,10 @@ for c in pybinds:
     if pybind not in sys.path:
         sys.path.insert(0, pybind)
 
+# openapi
+openapi_logger = logging.getLogger('sphinxcontrib.openapi.openapi30')
+openapi_logger.setLevel(logging.WARNING)
+
 
 # handles edit-on-github and old version warning display
 def setup(app):