summaryrefslogtreecommitdiff
path: root/lib/query/encoder.ml
diff options
context:
space:
mode:
Diffstat (limited to 'lib/query/encoder.ml')
-rw-r--r--lib/query/encoder.ml22
1 files changed, 12 insertions, 10 deletions
diff --git a/lib/query/encoder.ml b/lib/query/encoder.ml
index ba5435e..64464fd 100644
--- a/lib/query/encoder.ml
+++ b/lib/query/encoder.ml
@@ -291,7 +291,7 @@ module DataToCaqtiValues = Map (struct
include DefaultEncoder
type 'a t = 'a
- type env = string -> Model.value
+ type env = string -> Value.value
let f : type a. env -> a Intf.data -> a t =
fun provider Intf.{ name; content_type } ->
@@ -299,13 +299,15 @@ module DataToCaqtiValues = Map (struct
(* Check the value given by the provider and ensure it’s match the
expected type *)
match result with
- | Model.Typ.Seq _ -> raise TypeMismatch
- | Model.Typ.None ->
- (* The provider does not have any value for this property, use the
- default value*)
- Model.Typ.default_value content_type
- | Model.Typ.V (field_type', value) -> (
- match Model.Typ.eq content_type field_type' with
- | Some Equal -> value
- | None -> raise TypeMismatch)
+ | Value.Data.Any d -> (
+ match d with
+ | Value.Data.Seq _ -> raise TypeMismatch
+ | Value.Data.None ->
+ (* The provider does not have any value for this property, use the
+ default value*)
+ Model.Typ.default_value content_type
+ | Value.Data.V (field_type', value) -> (
+ match Model.Typ.eq content_type field_type' with
+ | Some Equal -> value
+ | None -> raise TypeMismatch))
end)