From 42d89b5025b4372c2deeba39a0268f826be32e83 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Adel=C3=B6w?= Date: Fri, 20 Feb 2026 11:47:51 +0100 Subject: [PATCH] small fixes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Fredrik Adelöw --- .changeset/rich-ducks-ring.md | 2 +- .../src/service/request/applyPredicateEntityFilterToQuery.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.changeset/rich-ducks-ring.md b/.changeset/rich-ducks-ring.md index 04848da4a7..ea8a3e8016 100644 --- a/.changeset/rich-ducks-ring.md +++ b/.changeset/rich-ducks-ring.md @@ -5,6 +5,6 @@ Added predicate-based entity filtering via POST /entities/by-query endpoint. -Supports `$all`, `$any`, `$not`, `$exists`, and `$in` operators for expressive entity queries. Integrated into the existing `queryEntities` flow with full cursor-based pagination, permission enforcement, and `totalItems` support. +Supports `$all`, `$any`, `$not`, `$exists`, `$in`, and `$hasPrefix` operators for expressive entity queries. Integrated into the existing `queryEntities` flow with full cursor-based pagination, permission enforcement, and `totalItems` support. The catalog client's `queryEntities()` method automatically routes to the POST endpoint when a `query` predicate is provided. diff --git a/plugins/catalog-backend/src/service/request/applyPredicateEntityFilterToQuery.ts b/plugins/catalog-backend/src/service/request/applyPredicateEntityFilterToQuery.ts index 88b064866d..5deb97019c 100644 --- a/plugins/catalog-backend/src/service/request/applyPredicateEntityFilterToQuery.ts +++ b/plugins/catalog-backend/src/service/request/applyPredicateEntityFilterToQuery.ts @@ -1,5 +1,5 @@ /* - * Copyright 2024 The Backstage Authors + * Copyright 2026 The Backstage Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -83,7 +83,7 @@ export function applyPredicateEntityFilterToQuery(options: { const { filter, targetQuery, onEntityIdField, knex } = options; // We do not support top-level primitives; all matching happens through objects - if (!filter || typeof filter !== 'object' || Array.isArray(filter)) { + if (!isObject(filter)) { throw new InputError( `Invalid filter predicate: top-level primitive values are not supported. ` + `Wrap the value in a field expression, e.g. { "kind": ${JSON.stringify(