swagger-api / swagger-api/swagger-codegen

Docs strings for python aren't parsed properly by sphinx

Open
#9,630 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Mustache
Stars
17.8k
Forks
6k
PR merge metrics
No merged PRs in 30d

Description

Description

Sphinx is defacto the documentation systems for Python (although it can be used and is used also by projects in other languages - a notable example is the linux kernel). Hence, when working with code for Python which is generated by swagger I'd expect the doc strings to render properly with sphinx.
Currently, the doc strings aren't rendered properly. This is how it should be rendered:

image

This is how it is actually rendered:

image

Suggest a fix/enhancement

To render the documentation properly, the output format should be slightly modified. Here is a diff of how the output should be modified to:

image

Swagger-codegen version

See here
https://github.com/kubernetes-client/python/blob/master/scripts/update-client.sh

Swagger declaration file content or url

https://github.com/kubernetes-client/python/blob/master/scripts/swagger.json

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with scripts/update-client.sh and scripts/swagger.json to reproduce the generated Python documentation and compare its docstrings with the expected Sphinx rendering shown in the issue. Locate the Python output template involved; done means the generated docstrings render in Sphinx with the formatting shown in the expected example.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
documentation
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
40/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.