mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-12-03 18:00:36 +00:00
chore: rm unused func
Signed-off-by: Sébastien Han <seb@redhat.com>
This commit is contained in:
parent
e3cb8ed74a
commit
9d14d6d313
1 changed files with 0 additions and 27 deletions
|
|
@ -11,7 +11,6 @@ FastAPI-based OpenAPI generator for Llama Stack.
|
||||||
|
|
||||||
import importlib
|
import importlib
|
||||||
import inspect
|
import inspect
|
||||||
import json
|
|
||||||
import pkgutil
|
import pkgutil
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from typing import Annotated, Any, get_args, get_origin
|
from typing import Annotated, Any, get_args, get_origin
|
||||||
|
|
@ -908,32 +907,6 @@ def validate_openapi_schema(schema: dict[str, Any], schema_name: str = "OpenAPI
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
||||||
def validate_schema_file(file_path: Path) -> bool:
|
|
||||||
"""
|
|
||||||
Validate an OpenAPI schema file (YAML or JSON).
|
|
||||||
|
|
||||||
Args:
|
|
||||||
file_path: Path to the schema file
|
|
||||||
|
|
||||||
Returns:
|
|
||||||
True if valid, False otherwise
|
|
||||||
"""
|
|
||||||
try:
|
|
||||||
with open(file_path) as f:
|
|
||||||
if file_path.suffix.lower() in [".yaml", ".yml"]:
|
|
||||||
schema = yaml.safe_load(f)
|
|
||||||
elif file_path.suffix.lower() == ".json":
|
|
||||||
schema = json.load(f)
|
|
||||||
else:
|
|
||||||
print(f"❌ Unsupported file format: {file_path.suffix}")
|
|
||||||
return False
|
|
||||||
|
|
||||||
return validate_openapi_schema(schema, str(file_path))
|
|
||||||
except Exception as e:
|
|
||||||
print(f"❌ Failed to read {file_path}: {e}")
|
|
||||||
return False
|
|
||||||
|
|
||||||
|
|
||||||
def _fix_schema_recursive(obj: Any) -> None:
|
def _fix_schema_recursive(obj: Any) -> None:
|
||||||
"""Recursively fix schema issues: exclusiveMinimum and null defaults."""
|
"""Recursively fix schema issues: exclusiveMinimum and null defaults."""
|
||||||
if isinstance(obj, dict):
|
if isinstance(obj, dict):
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue