forest_admin_datasource_toolkit 1.9.1 → 1.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9ecfa695025f486d1fc06688fbc5c22bbe916de9013cf0bc0ad1394c85b8f4c5
|
4
|
+
data.tar.gz: 78d28d3ce20c0a1521359025a54ee3208dcb7fa741ae65b56e39937cdd066958
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6f71f352daaa055fc21d810a25cf83ef7d47ff4844d23e847b3c4ed810429645184f570ab14e2392d0987c1d2c9618f2d9e05f78821e1955acd5af732770c557
|
7
|
+
data.tar.gz: 34ab089fd86f4174e71ba8e28eefe3ba5d47eede4c7adfaecb4ca681ab5e105157bcbff59f276fdd5d3b6a7c558e2aba27ce2d44dd3c14ca4372f2e3082b9692
|
@@ -107,7 +107,21 @@ module ForestAdminDatasourceToolkit
|
|
107
107
|
PrimitiveType::POINT => [PrimitiveType::POINT, nil]
|
108
108
|
}
|
109
109
|
|
110
|
-
|
110
|
+
return allowed_types unless primitive_type
|
111
|
+
|
112
|
+
# Handle array of objects (embedded documents) - e.g. [{"street" => "String", "city" => "String"}]
|
113
|
+
return allowed_types[PrimitiveType::JSON] if primitive_type.is_a?(Array) && primitive_type.first.is_a?(Hash)
|
114
|
+
|
115
|
+
# Handle hash objects (embedded documents) - e.g. {"street" => "String", "city" => "String"}
|
116
|
+
return allowed_types[PrimitiveType::JSON] if primitive_type.is_a?(Hash)
|
117
|
+
|
118
|
+
# Handle array types like '[String]', '[Number]', etc.
|
119
|
+
if primitive_type.to_s.start_with?('[') && primitive_type.to_s.end_with?(']')
|
120
|
+
element_type = primitive_type.to_s[1..-2]
|
121
|
+
return allowed_types[element_type]
|
122
|
+
end
|
123
|
+
|
124
|
+
allowed_types[primitive_type]
|
111
125
|
end
|
112
126
|
|
113
127
|
def self.compute_allowed_types_for_operators
|
@@ -19,6 +19,12 @@ module ForestAdminDatasourceToolkit
|
|
19
19
|
|
20
20
|
return PrimitiveTypes::BINARY if value.is_a?(buffer)
|
21
21
|
|
22
|
+
return PrimitiveTypes::JSON if value.is_a?(Hash) && type_context.is_a?(Array) && type_context.first.is_a?(Hash)
|
23
|
+
|
24
|
+
return PrimitiveTypes::JSON if value.is_a?(Hash) && type_context.is_a?(Hash)
|
25
|
+
|
26
|
+
return PrimitiveTypes::JSON if value.is_a?(Array)
|
27
|
+
|
22
28
|
nil
|
23
29
|
end
|
24
30
|
|