This document provides detailed documentation for the pentest library.
The parser module handles parsing OpenAPI/Swagger specifications.
from pentestkit.parser import OpenAPIParser
parser = OpenAPIParser(source="swagger.json")
endpoints = parser.parse("swagger.json")
base_url = parser.get_base_url()Methods:
parse(source: str) -> List[Endpoint]: Parse API specification from a URL or file pathget_format() -> SpecFormat: Get the format of the specification (OpenAPI v2 or v3)get_base_url() -> Optional[str]: Get the base URL from the specification