- Stringify Object.signature() instead of str()-ing the bound method, which produced "<bound method Class.signature of ...>" reprs - Skip alias members that cannot resolve (stdlib/third-party imports) while preserving resolvable package re-exports; return None for empty signatures (classes without __init__ args) - Add MCP renderer regression tests for signature cleanliness, alias filtering, and package re-export preservation
67 lines
3.5 KiB
JSON
67 lines
3.5 KiB
JSON
{
|
|
"module": "docforge.cli.api_utils",
|
|
"content": {
|
|
"path": "docforge.cli.api_utils",
|
|
"docstring": "# Summary\n\nUtilities for building API documentation from an OpenAPI specification.",
|
|
"objects": {
|
|
"SWAGGER_SPEC_FILENAME": {
|
|
"name": "SWAGGER_SPEC_FILENAME",
|
|
"kind": "attribute",
|
|
"path": "docforge.cli.api_utils.SWAGGER_SPEC_FILENAME",
|
|
"signature": null,
|
|
"docstring": null
|
|
},
|
|
"OpenAPIMetadata": {
|
|
"name": "OpenAPIMetadata",
|
|
"kind": "class",
|
|
"path": "docforge.cli.api_utils.OpenAPIMetadata",
|
|
"signature": "OpenAPIMetadata(site_name: str, site_description: str | None, site_author: str | None)",
|
|
"docstring": "Metadata derived from the ``info`` block of an OpenAPI specification.\n\nAttributes:\n site_name: Spec title, used as the MkDocs site name.\n site_description: Spec description, used as the site description.\n site_author: Contact name (fallback: contact email), used as the\n site author.",
|
|
"members": {
|
|
"site_name": {
|
|
"name": "site_name",
|
|
"kind": "attribute",
|
|
"path": "docforge.cli.api_utils.OpenAPIMetadata.site_name",
|
|
"signature": null,
|
|
"docstring": null
|
|
},
|
|
"site_description": {
|
|
"name": "site_description",
|
|
"kind": "attribute",
|
|
"path": "docforge.cli.api_utils.OpenAPIMetadata.site_description",
|
|
"signature": null,
|
|
"docstring": null
|
|
},
|
|
"site_author": {
|
|
"name": "site_author",
|
|
"kind": "attribute",
|
|
"path": "docforge.cli.api_utils.OpenAPIMetadata.site_author",
|
|
"signature": null,
|
|
"docstring": null
|
|
}
|
|
}
|
|
},
|
|
"load_openapi_spec": {
|
|
"name": "load_openapi_spec",
|
|
"kind": "function",
|
|
"path": "docforge.cli.api_utils.load_openapi_spec",
|
|
"signature": "load_openapi_spec(spec_path: Path) -> dict[Any, Any]",
|
|
"docstring": "Load and validate an OpenAPI specification from a JSON file.\n\nArgs:\n spec_path (Path):\n Path to the OpenAPI JSON specification file.\n\nReturns:\n dict:\n The parsed OpenAPI specification.\n\nRaises:\n click.ClickException:\n If the file cannot be read or the ``info`` block is invalid."
|
|
},
|
|
"derive_metadata": {
|
|
"name": "derive_metadata",
|
|
"kind": "function",
|
|
"path": "docforge.cli.api_utils.derive_metadata",
|
|
"signature": "derive_metadata(spec: dict[Any, Any]) -> OpenAPIMetadata",
|
|
"docstring": "Derive MkDocs site metadata from an OpenAPI spec ``info`` block.\n\nArgs:\n spec (dict):\n Parsed OpenAPI specification.\n\nReturns:\n OpenAPIMetadata:\n Site name, description, and author derived from the spec."
|
|
},
|
|
"generate_api_sources": {
|
|
"name": "generate_api_sources",
|
|
"kind": "function",
|
|
"path": "docforge.cli.api_utils.generate_api_sources",
|
|
"signature": "generate_api_sources(spec: dict[Any, Any], docs_dir: Path) -> None",
|
|
"docstring": "Generate swagger-enabled Markdown sources and the spec copy.\n\nThe specification is written as ``openapi.json`` inside ``docs_dir`` and\nan ``index.md`` embedding the swagger UI is generated alongside it.\n\nArgs:\n spec (dict):\n Parsed OpenAPI specification.\n docs_dir (Path):\n Directory (for example ``docs/api``) where the swagger\n sources are written."
|
|
}
|
|
}
|
|
}
|
|
} |