Hi Varun,
Thank you for your response!
If I understand correctly, the current behavior in Lithium 15.6, is that the APIs /nodes/count, /nodes/nested/count returns different values depending on the category's hidden state (ignoring param show_hidden in either case).
I tried creating two categories (1 visible, 1 hidden) with two children respectively (1 visible, 1 hidden) and adding a text endpoint with contents:
<#assign count1 = restadmin("/categories/id/catA/nodes/count")/>
<#assign count2 = restadmin("/categories/id/catA/nodes/count?show_hidden=true")/>
<#assign count3 = restadmin("/categories/id/catA/nodes/count?show_hidden=false")/>
<#assign count4 = restadmin("/categories/id/catB/nodes/count")/>
<#assign count5 = restadmin("/categories/id/catB/nodes/count?show_hidden=true")/>
<#assign count6 = restadmin("/categories/id/catB/nodes/count?show_hidden=false")/>
/catA/nodes/count = ${count1.value} (expect 1)
/catA/nodes/count (+hidden) = ${count2.value} (expect 2)
/catA/nodes/count (-hidden) = ${count3.value} (expect 1)
/catB/nodes/count = ${count4.value} (expect 1)
/catB/nodes/count (+hidden) = ${count5.value} (expect 2)
/catB/nodes/count (-hidden) = ${count6.value} (expect 1)
Which outputs:
/catA/nodes/count = 1 (expect 1)
/catA/nodes/count (+hidden) = 1 (expect 2)
/catA/nodes/count (-hidden) = 1 (expect 1)
/catB/nodes/count = 2 (expect 1)
/catB/nodes/count (+hidden) = 2 (expect 2)
/catB/nodes/count (-hidden) = 2 (expect 1)
If I need a true count of all nodes in a category (that may or may not be hidden as well), do you recommend that I paginate through /nodes?show_hidden=true and then return the count manually?
Do you know if Lithium 15.7 will support show_hidden param for /count?