@@ -346,8 +346,33 @@ export class ObjectStackProtocolImplementation implements ObjectStackProtocol {
346346 else if ( options [ key ] === 'false' ) options [ key ] = false ;
347347 }
348348
349- // Handle OData style $filter if present, or flat filters
350- // This is a naive implementation, a real OData parser is needed for complex scenarios.
349+ // Flat field filters: REST-style query params like ?id=abc&status=open
350+ // After extracting all known query parameters, any remaining keys are
351+ // treated as implicit field-level equality filters. This is the standard
352+ // REST convention used by the client when serializing simple filter maps
353+ // (e.g. `{ filters: { id: "..." } }` → `?id=...`).
354+ const knownParams = new Set ( [
355+ 'top' , 'skip' , 'limit' , 'offset' ,
356+ 'sort' , 'orderBy' ,
357+ 'select' , 'fields' ,
358+ 'filter' , 'filters' , '$filter' ,
359+ 'populate' , 'expand' , '$expand' ,
360+ 'distinct' , 'count' ,
361+ 'aggregations' , 'groupBy' ,
362+ 'search' , 'context' ,
363+ ] ) ;
364+ if ( ! options . filter ) {
365+ const implicitFilters : Record < string , unknown > = { } ;
366+ for ( const key of Object . keys ( options ) ) {
367+ if ( ! knownParams . has ( key ) ) {
368+ implicitFilters [ key ] = options [ key ] ;
369+ delete options [ key ] ;
370+ }
371+ }
372+ if ( Object . keys ( implicitFilters ) . length > 0 ) {
373+ options . filter = implicitFilters ;
374+ }
375+ }
351376
352377 const records = await this . engine . find ( request . object , options ) ;
353378 return {
0 commit comments