I have a strange behaviour by using the REST API. When I want to list the child pages of a specific page like XXX/spaces/XXSpecificPageXX/pages/WebHome/children, then not all childs are listed.
Using the “normal” front end and the /?viewer=children parameter after the Page URI will list all childs.
Your question is interesting, it shows us that the “children” REST action has not been upgraded to handle Nested Pages. It only shows you pages that have the current one as “parent”, in the old “parent-child relationship” way (some explanations).
If you wish to have ALL the children, in a hierarchal way (just like the breadcrumb does or viewer=children), then you need to call:
XXX/spaces/XXSpecificPageXX/pages/
But it works only if XXSpecificPageXX is not a terminal page.
When I access a space called Development and want to see all direct childs using the link XXX/Development/?viewer=children, then I am getting the expected result. However, when I am going to use the RESTful API via xxx/spaces/Development/pages/WebHome/children, I am getting a wrong result even though all children are a direct child of Development.
That’s because as @gdelhumeau indicated you need to use xxx/spaces/Development/pages/. WebHome is itself a child of space Development (which happen to be used as its home page).