From c0bd2b810955191ca59b49b86554bab79ab83e7f Mon Sep 17 00:00:00 2001 From: Paulo Coghi Date: Fri, 10 Jul 2026 20:58:32 +0200 Subject: [PATCH] chore: expand TypedCondition on Query with FieldDescriptor, for auxiliary data for adapters --- src/service/query.cr | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/service/query.cr b/src/service/query.cr index 778c574..4ae3732 100644 --- a/src/service/query.cr +++ b/src/service/query.cr @@ -23,7 +23,7 @@ module Alumna end # 2. Coerced condition holding native Crystal types - record TypedCondition, op : Op, value : AnyData + record TypedCondition, op : Op, value : AnyData, fd : FieldDescriptor? getter filters : Hash(String, Array(Condition)) getter limit : Int32? @@ -101,13 +101,13 @@ module Alumna return ServiceError.bad_request("Invalid type for query parameter #{key}") if cast_val.nil? arr << cast_val end - res[key] << TypedCondition.new(c.op, arr.as(AnyData)) + res[key] << TypedCondition.new(c.op, arr.as(AnyData), fd) else raw_val = cv.is_a?(Array(String)) ? cv.first : cv cast_val = cast_value(raw_val, type, fd) return ServiceError.bad_request("Invalid type for query parameter #{key}") if cast_val.nil? - res[key] << TypedCondition.new(c.op, cast_val) + res[key] << TypedCondition.new(c.op, cast_val, fd) end end end