Summary
Extend the generated Python client with comprehensive documentation generation capabilities, building on the docstring improvements requested in #85 .
Current State
Issue description and / or title of properties and endpoints #85 requests better docstrings for properties and endpoints from OpenAPI schema descriptions
Generated code currently has minimal documentation
Users must manually document the generated API clients
No automated way to produce comprehensive API documentation from the generated code
Proposed Enhancement
Generate complete documentation packages alongside the Python client code, leveraging both the OpenAPI schema information and the generated Python code structure.
Goals
Enhanced Docstrings (builds on description and / or title of properties and endpoints #85 ):
Extract and include title and description from OpenAPI schema for all properties
Add comprehensive docstrings for service endpoints with parameter descriptions
Include return type documentation with response schema details
Document authentication requirements and error responses
Documentation Generation :
Generate Sphinx-compatible documentation structure
Support mkdocs output format as alternative
Include auto-generated API reference from Python docstrings
Create user guides with code examples for each endpoint
Rich Content :
Generate markdown documentation from OpenAPI schema
Include request/response examples from OpenAPI examples
Create usage guides with authentication setup
Generate type reference documentation
Implementation Ideas
Template Extensions :
Enhance existing Jinja templates to include comprehensive docstrings
Add new templates for documentation generation (conf.py, index.rst, etc.)
Template for mkdocs.yml configuration
Documentation Modules :
Add --generate-docs flag to CLI
Support --docs-format choice between sphinx/mkdocs
Include documentation build scripts in generated output
Content Generation :
Parse OpenAPI examples and convert to Python code examples
Generate endpoint-specific usage guides
Create comprehensive type documentation
Example Output Structure
generated_client/
├── client/ # Generated Python code (existing)
├── docs/
│ ├── conf.py # Sphinx configuration
│ ├── index.rst # Main documentation index
│ ├── api/ # Auto-generated API reference
│ ├── guides/ # Usage guides per endpoint
│ └── examples/ # Code examples
├── mkdocs.yml # Alternative mkdocs config
└── README.md # Enhanced with documentation links
Dependencies
Benefits
Self-documenting generated clients
Reduced manual documentation effort for API consumers
Professional-quality documentation output
Better developer experience with generated clients
Open Questions
Should documentation generation be opt-in via CLI flag or always generated?
Preference for default format: Sphinx vs mkdocs?
Should we generate interactive documentation (like Swagger UI) as well?
How to handle custom template modifications while preserving doc generation?
Related Issues
This enhancement would significantly improve the value proposition of generated clients by providing comprehensive, professional documentation out of the box.
Summary
Extend the generated Python client with comprehensive documentation generation capabilities, building on the docstring improvements requested in #85.
Current State
Proposed Enhancement
Generate complete documentation packages alongside the Python client code, leveraging both the OpenAPI schema information and the generated Python code structure.
Goals
Enhanced Docstrings (builds on description and / or title of properties and endpoints #85):
titleanddescriptionfrom OpenAPI schema for all propertiesDocumentation Generation:
Rich Content:
Implementation Ideas
Template Extensions:
Documentation Modules:
--generate-docsflag to CLI--docs-formatchoice between sphinx/mkdocsContent Generation:
Example Output Structure
Dependencies
--use-pydantic-v2and--use-orjsonflagsBenefits
Open Questions
Related Issues
This enhancement would significantly improve the value proposition of generated clients by providing comprehensive, professional documentation out of the box.