INNER CODE UNIT · Python

main

kubeai-project/kubeai · hack/filter-openapi-components.py:38

def main():
    parser = argparse.ArgumentParser(
        description="Filter an OpenAPI spec down to a specific path and method, including only the relevant components."
    )
    parser.add_argument(
        "spec_file", help="Path to the OpenAPI spec file (YAML or JSON)"
    )
    parser.add_argument("path", help="Path to filter on (e.g. '/chat/completions')")
    parser.add_argument("method", help="HTTP method (e.g. 'post')")
    parser.add_argument(
        "--output",
        "-o",
        help="Output file; if not provided, prints to stdout",
        default=None,
    )
    args = parser.parse_args()

    # Load the OpenAPI spec

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…