I use /v2/observations/species_counts because the iNaturalist site uses v2 api on the species view. v2 api docs do not mention leaf taxa. The docs do state:
Available values : kingdom, phylum, subphylum, superclass, class, subclass, infraclass, subterclass, superorder, order, suborder, infraorder, parvorder, zoosection, zoosubsection, superfamily, epifamily, family, subfamily, supertribe, tribe, subtribe, genus, genushybrid, subgenus, section, subsection, complex, species, hybrid, subspecies, variety, form, infrahybrid
As a software developer, when api docs list all available values, I expect all the values to behave the same way. Since all the ranks species and above return taxa for that rank, I expect all the ranks below species to also return taxa for the rank.
keirmorse is a professional field botanist. When keirmorse pointed out issues with the way I implemented ranks below species, I updated the code. The changes improved the way he can examine iNat data. He gave specific examples that shows the negative impact of the way iNat Explore page handles ranks below species.
When the code gets in the way of exploration, identification, and research, the code needs to change.