JSONItem_MTC , the drop in replacement for the classic framework JSONItem
If you're using JSONItem, I encourage you to consider this instead.
I've been using
JSONItem_MTC in a project, and noticed the speed improvement. So thanks a lot!
In another project it seems I have run into a limitation, which doesn't make
JSONItem_MTC a "drop in replacement" ;)
It seems that
JSONItem_MTC can't handle Array-Values :(
Here is an example project showing the issue/difference.
This works as expected with
Dim oJSON As New JSONItem
oJSON.Value("field") = "a_fieldname"
oJSON.Value("operator") = "IN"
oJSON.Value("values") = Array(12, 15, 20)
JSONItem_MTC however raises a
JSONException( "Illegal Value", 10 ).
One could modify it's
.Validate to cope with Arrays (get the DataType of the Array-element-type -> TypeArray is logically OR'ed with the element type):
Dim iCheckVariantType As Integer = Bitwise.BitAnd(value.type, Bitwise.OnesComplement(Variant.TypeArray))
select case iCheckVariantType
.Serialize -> .EncodeValue will fail.
That's why I've stopped trying the do further modifications... at least before asking if you intend
JSONItem_MTC to handle Array-values sooner or later?