When OpenAPIConfig.use_handler_docstrings = True
, OpenAPI operation descriptions are automatically generated from handler methods' docstrings. It would be great if this feature could be expand to include parameter descriptions extracted from the reST.
This handler:
@get("/{a:int}/{b:str}")
async def foobar(a: int, b: str) -> str:
"""
Retrieve the specified document.
:param a: The first path parameter.
:param b: The second path parameter.
"""
...
Would generate this OpenAPI schema:
{
"paths": {
"/{a}/{b}": {
"get": {
"summary": "Foobar",
"description": "Retrieve the specified document.",
"operationId": "ABFoobar",
"parameters": [
{
"name": "a",
"in": "path",
"schema": {
"type": "integer",
"description": "The first path parameter"
},
"description": "The first path parameter",
},
{
"name": "b",
"in": "path",
"schema": {
"type": "string",
"description": "The second path parameter"
},
"description": "The second path parameter",
}
],
...
Impacts:
Drawbacks:
No response
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too