Hey guys, I'm struggling a bit to make a dynamic interface work correctly.
I've added a TS Playground link to show the issue.
But to explain, i define the ResponseTypes interface, do define the output response, based on which endpoints being used. But it matches all of them, and creates like a merge value of all of the key values defined the the interface, and there makes the returnvalue incorrectly, as it should always only match the EXACT key.
In the playground example, it should only return the type from "/api/data/athletes" entry.
The Playground lets you write TypeScript or JavaScript online in a safe and sharable way.