mloskot
4 years agoOccasional Visitor
Generating Python client with valid docstrings
I'm using the currently latest swagger-codegen-cli-3.0.26.jar to generate Python client for my API.
Then, I'm using Sphinxa to generate the client API reference in HTML format.
The toolset invocation is pretty standard:
sphinx-apidoc -f -o docs-python\_modules -e -P python\myclient
docs-python\make.bat clean
docs-python\make.bat html
with a bunch of extensions in my `conf.py` for Sphinx:
extensions = [
'sphinx.ext.napoleon',
'sphinx.ext.autodoc',
'sphinx.ext.autosummary',
'sphinx.ext.coverage'
]
The `make.bat html` command outputs lots of warnings like these:
WARNING: Block quote ends without a blank line; unexpected unindent.
WARNING: Unexpected indentation.
I noticed the generator outputs docstrings which are not entirely valid.
It also includes lots of the directives like `# noqa: E501` which are dedicated for the Python linters.
Is there any way to control the docstring flavour or format that `swagger-codegen` outputs?
If the above looks like a bug, is https://github.com/swagger-api/swagger-codegen the right place to report it?