From 09adf856dcad890809c100fa50b41c858e4e6e7b Mon Sep 17 00:00:00 2001 From: Stefano Fiorucci Date: Mon, 9 Dec 2024 10:59:21 +0100 Subject: [PATCH] rm openapi spec util (#8613) --- .github/utils/generate_openapi_specs.py | 37 ------------------------- 1 file changed, 37 deletions(-) delete mode 100755 .github/utils/generate_openapi_specs.py diff --git a/.github/utils/generate_openapi_specs.py b/.github/utils/generate_openapi_specs.py deleted file mode 100755 index a5b14a8943..0000000000 --- a/.github/utils/generate_openapi_specs.py +++ /dev/null @@ -1,37 +0,0 @@ -#!/usr/bin/env python3 - -import json -from pathlib import Path -import os -import sys - -import logging - -logging.basicConfig(level=logging.INFO) - - -sys.path.append(".") -from rest_api.utils import get_openapi_specs, get_app, get_pipelines # pylint: disable=wrong-import-position -from haystack import __version__ # pylint: disable=wrong-import-position - -REST_PATH = Path("./rest_api/rest_api").absolute() -PIPELINE_PATH = str(REST_PATH / "pipeline" / "pipeline_empty.haystack-pipeline.yml") -APP_PATH = str(REST_PATH / "application.py") - -os.environ["PIPELINE_YAML_PATH"] = PIPELINE_PATH - -logging.info("Loading OpenAPI specs from %s with pipeline at %s", APP_PATH, PIPELINE_PATH) - -# To initialize the app and the pipelines -get_app() -get_pipelines() - -# Generate the openapi specs -specs = get_openapi_specs() -# Add `x-readme` to disable proxy and limit sample languages on documentation (see https://docs.readme.com/main/docs/openapi-extensions) -specs.update({"x-readme": {"proxy-enabled": False, "samples-languages": ["curl", "python"]}}) - -# Dump the specs into a JSON file -with open("openapi.json", "w") as f: - json.dump(specs, f, indent=4) - f.write("\n") # We need to add a newline, otherwise there will be a conflict with end-of-file-fixer pre-commit hook