Classes
OpenAPIExtractor
Extracts documentation from OpenAPI specifications.
Supports OpenAPI 3.0 and 3.1 (YAML or JSON).
OpenAPIExtractor
Extracts documentation from OpenAPI specifications.
Supports OpenAPI 3.0 and 3.1 (YAML or JSON).
Inherits from
ExtractorMethods 2
extract
Extract documentation elements from OpenAPI spec file.
extract
def extract(self, source: Path) -> list[DocElement]
Extract documentation elements from OpenAPI spec file.
Parameters 1
source |
Path |
Path to openapi.yaml or openapi.json |
Returns
List of DocElement objectslist[DocElement]
—
get_output_path
Determine output path for OpenAPI elements.
Structure:
- Overview: index.md
- …
get_output_path
def get_output_path(self, element: DocElement) -> Path | None
Determine output path for OpenAPI elements.
Structure:
- Overview: index.md
- Endpoints: endpoints/{tag}/{operation_id}.md
- Schemas: schemas/{name}.md
Parameters 1
element |
DocElement |
Returns
Path | None
Internal Methods 3
_extract_overview
Extract API overview information.
_extract_overview
def _extract_overview(self, spec: dict[str, Any], source: Path) -> DocElement
Extract API overview information.
Parameters 2
spec |
dict[str, Any] |
|
source |
Path |
Returns
DocElement
_extract_endpoints
Extract all path operations.
_extract_endpoints
def _extract_endpoints(self, spec: dict[str, Any]) -> list[DocElement]
Extract all path operations.
Parameters 1
spec |
dict[str, Any] |
Returns
list[DocElement]
_extract_schemas
Extract component schemas.
_extract_schemas
def _extract_schemas(self, spec: dict[str, Any]) -> list[DocElement]
Extract component schemas.
Parameters 1
spec |
dict[str, Any] |
Returns
list[DocElement]