Closed agzam closed 4 months ago
This behaviour is currently by-design - the docs desrcribe this to some extent:
Host: The last defined heading's URL host will be used.
Path: All paths will be concatenated, starting with the first heading (i.e. the topmost parent).
I have run into cases however where I re-defined the host part of the URL at some middle point of the Org heading hierarchy, and it is true that the result is a bit unexpected (i.e. the last host, but all the paths appended). Maybe if the host is re-defined at any level, this should effectively reset all other components of the URL as well. This would be a relatively large change in terms of user experience.
But why not fix it? The template always starts with "http|https", right? Can it somehow reset the "topmost parent" if it gets redefined down the route while traversing the headings?
Hmm, wait. I might be missing something else there. Need to consult the code and think of some other use cases.
If there are multiple templates within the same hierarchy of headings, i.e.,
Attempting to send a request for
/breeds
, tries to use the route:https://api.thecatapi.com/v1/rest//breeds
, whereas it should behttps://api.thecatapi.com/v1/breeds
.