When there is expand query parameter set, it doesn't stringify the fetch URL properly.
For example, when I have { expand: ['free_web_content'] }
Result: https://api.beehiiv.com/v2/publications/:publicationId/posts/:postId?expand=%5B%22free_web_content%22%5D
Expected: https://api.beehiiv.com/v2/publications/:publicationId/posts/:postId?expand=free_web_content
It seems that we use qs package. The issue is it doesn't process nested keys, which is documented on the site.
(this cannot convert nested objects, such as a={b:1},{c:d})
– https://github.com/ljharb/qs?tab=readme-ov-file#parsing-arrays
(The documentation refers to parsing, but I assume that's the case of stringify-ing as well)
When there is
expandquery parameter set, it doesn't stringify the fetch URL properly.For example, when I have
{ expand: ['free_web_content'] }Result:
https://api.beehiiv.com/v2/publications/:publicationId/posts/:postId?expand=%5B%22free_web_content%22%5DExpected:
https://api.beehiiv.com/v2/publications/:publicationId/posts/:postId?expand=free_web_contentIt seems that we use
qspackage. The issue is it doesn't process nested keys, which is documented on the site.(The documentation refers to parsing, but I assume that's the case of stringify-ing as well)