chore: re-add missing endpoints

_filter_combined_schema was using path-level filtering with
_is_path_deprecated, which excluded entire paths if any operation was
deprecated. Since /v1/toolgroups has both GET (not deprecated) and POST
(deprecated), the entire path was excluded, removing the GET operation
and its response schema. Updated _filter_combined_schema to use
operation-level filtering, matching _filter_schema_by_version

Signed-off-by: Sébastien Han <seb@redhat.com>
This commit is contained in:
Sébastien Han 2025-11-12 14:30:27 +01:00
parent 2cb0c31edd
commit 73861b504d
No known key found for this signature in database
3 changed files with 6833 additions and 1554 deletions

View file

@ -1647,19 +1647,30 @@ def _filter_combined_schema(openapi_schema: dict[str, Any]) -> dict[str, Any]:
# Filter paths to include stable (v1) and experimental (v1alpha, v1beta), excluding deprecated
filtered_paths = {}
for path, path_item in filtered_schema["paths"].items():
# Check if path has any deprecated operations
is_deprecated = _is_path_deprecated(path_item)
# Skip deprecated endpoints
if is_deprecated:
if not isinstance(path_item, dict):
continue
# Include stable v1 paths
if _is_stable_path(path):
filtered_paths[path] = path_item
# Include experimental paths (v1alpha or v1beta)
elif _is_experimental_path(path):
filtered_paths[path] = path_item
# Filter at operation level, not path level
# This allows paths with both deprecated and non-deprecated operations
filtered_path_item = {}
for method in ["get", "post", "put", "delete", "patch", "head", "options"]:
if method not in path_item:
continue
operation = path_item[method]
if not isinstance(operation, dict):
continue
# Skip deprecated operations
if operation.get("deprecated", False):
continue
filtered_path_item[method] = operation
# Only include path if it has at least one operation after filtering
if filtered_path_item:
# Check if path matches version filter (stable or experimental)
if _is_stable_path(path) or _is_experimental_path(path):
filtered_paths[path] = filtered_path_item
filtered_schema["paths"] = filtered_paths