Does the new FilterGroupObject supersede Filter[]?

Answered
eze@wejugo.com asked on August 20, 2021

We are implementing the Custom Data API in Go, and having a json field have two different schemas  depending on the sent data is hard to implement cleanly. 
If I set filter.advanced = true in the /fields response, can I just assume that the /select query.filter and /members filter fields will always be sent with the FilterGroupObject schema?

5 answers

Public
Vera Didenko Vera Didenko Flexmonster August 23, 2021

Hello,
 
Thank you for your question.
 
The filter object type in select.query.filter and members.filter depends on the version that your server sends in the /handshake response:
 
If the version sent in the /handshake response is 2.8.22 or later, select.query.filter and members.filter will be sent as a FilterGroupObject.
Otherwise, if the version sent in the /handshake response is 2.8.5 or /handshake is not implemented, select.query.filter and members.filter will come as an array of Filter Objects.
 
Feel free to reach out should further questions arise.
 
Kind regards,
Vera

Public
eze@wejugo.com August 23, 2021

Great! That makes things easier! Thanks

Public
eze@wejugo.com August 23, 2021

Just wanting to report that there is an error either in the documentation or in the code. In the members request documentation it the filter field is defined as either an array of FilterObject or a FilterGroupObject.
What actually gets sent by the component as of verison 2.9.5 is not an array of FilterObject but a single FilterObject (when the /handshake advertises version 2.8.5 compatibility). This is a break in compatibility with earlier versions before 2.8.23 where filter was an array.

Public
Vera Didenko Vera Didenko Flexmonster August 26, 2021

Hello,
 
Thank you for reporting this to us.
 
You are right; before v2.8.23 of Flexmonster, the filter field in the /members request came as an array of FilterObject (when the /handshake advertises version 2.8.5 compatibility). Afterward, the filter field type changed to a single FilterObject.
 
Our team will look into this in more detail, and we will share the results with the ETA 21st of September.
Please let us know if this works fine for you.
 
In the meantime, feel free to reach out if questions arise.
 
Kind regards,
Vera

Public
Vera Didenko Vera Didenko Flexmonster September 21, 2021

Hello,
 
Hope all is well.
 
Our team researched the filter structure changes. We would like to confirm that the code is correct - it should be a single FilterObject instead of an array. Our team will update the documentation accordingly.
 
As always, feel free to reach out if questions arise.
 
Kind regards,
Vera

Please login or Register to Submit Answer