This post can be a solution, but I guess there could be something more linear or native:
The official REST API guide is not really clear to me, and doesn't have much examples.
I've got a custom 'dealer_areas' taxonomy, hierarchical (continents > countries > regions).
I need to build a small js app based on that and, even if I could use the 'regular' admin-ajax way, this time I'd like to use the REST API instead.
I use https://httpie.org/ client (just to have some syntax sugar and pretty printing), but it could be any. If I ask for this, I get some terms, but not all:
http GET dev.example.com/my-site/wp-json/wp/v2/dealer_areas
I get terms from every nesting level, but not all.. And they're not returned based on post counts, so it really seems there's no logic in this.
Anyway, I'd like a direct way to get all the terms from all nesting levels (even empty ones).
Is there any or am I forced to create a custom route?