From 32f7237693ab46ecec7a292f716de5328b087f28 Mon Sep 17 00:00:00 2001 From: Simon Pinfold Date: Wed, 26 Aug 2026 08:13:51 -0700 Subject: [PATCH] fix(assets): align openapi.yaml with served contract and drop dead response kwargs (review-5) --- app/assets/api/routes.py | 6 +----- openapi.yaml | 21 ------------------- .../test_asset_response_loader_path.py | 2 -- 3 files changed, 1 insertion(+), 28 deletions(-) diff --git a/app/assets/api/routes.py b/app/assets/api/routes.py index c5ce56727..85ba7bd37 100644 --- a/app/assets/api/routes.py +++ b/app/assets/api/routes.py @@ -306,20 +306,16 @@ def _build_asset_response( else: preview_url = None if result.ref.file_path: - paths = compute_asset_response_paths(result.ref.file_path) - display_name = paths[1] if paths else None # In-root loader path (model category dropped): what model loaders consume. loader_path = result.ref.loader_path else: - display_name, loader_path = None, None + loader_path = None asset_content_hash = result.asset.hash if result.asset else None return schemas_out.Asset( id=result.ref.id, name=result.ref.name, hash=asset_content_hash, loader_path=loader_path, - display_name=display_name, - asset_hash=asset_content_hash, size=int(result.asset.size_bytes) if result.asset else None, mime_type=result.asset.mime_type if result.asset else None, tags=result.tags, diff --git a/openapi.yaml b/openapi.yaml index e3f9609c5..69e268340 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -7,10 +7,6 @@ components: description: Timestamp when the asset was created format: date-time type: string - display_name: - description: Display name of the asset. Mirrors name for backwards compatibility. - nullable: true - type: string file_path: description: Relative path in global-namespace-root form (e.g. "models/checkpoints/flux.safetensors") nullable: true @@ -23,9 +19,6 @@ components: description: Unique identifier for the asset format: uuid type: string - is_immutable: - description: Whether this asset is immutable (cannot be modified or deleted) - type: boolean job_id: description: ID of the job that created this asset, if available format: uuid @@ -148,10 +141,6 @@ components: AssetUpdated: description: Response returned when an existing asset is successfully updated. properties: - display_name: - description: Display name of the asset. Mirrors name for backwards compatibility. - nullable: true - type: string file_path: description: Relative path in global-namespace-root form (e.g. "models/checkpoints/flux.safetensors") nullable: true @@ -1714,11 +1703,6 @@ paths: name: name_contains schema: type: string - - description: JSON object for filtering by metadata fields - in: query - name: metadata_filter - schema: - type: string - description: Maximum number of assets to return (1-500) in: query name: limit @@ -2552,11 +2536,6 @@ paths: name: name_contains schema: type: string - - description: JSON object for filtering by metadata fields - in: query - name: metadata_filter - schema: - type: string - description: Maximum number of tags to return (1-1000, default 100) in: query name: limit diff --git a/tests-unit/assets_test/services/test_asset_response_loader_path.py b/tests-unit/assets_test/services/test_asset_response_loader_path.py index 7ae7c6f5a..2ce433b67 100644 --- a/tests-unit/assets_test/services/test_asset_response_loader_path.py +++ b/tests-unit/assets_test/services/test_asset_response_loader_path.py @@ -70,7 +70,6 @@ def test_null_stored_loader_path_is_served_as_null(tmp_path: Path): resp = _build_asset_response(result, {}) assert resp.loader_path is None - assert resp.display_name == "checkpoints/bar.safetensors" def test_all_path_fields_null_without_file_path(): @@ -80,4 +79,3 @@ def test_all_path_fields_null_without_file_path(): resp = _build_asset_response(result, {}) assert resp.loader_path is None - assert resp.display_name is None