I am trying to type the search endpoint of Spotify’s API. The documentation suggests that the return payload is of type
SearchResults, which is an object with all properties marked as optional. However, the documentation also suggests that the real typing of the response should be “we will only return the keys that you asked for”.
How can I force the response to still return the whole type with all properties marked optional, even if the list is not a literal type?
I have created a TypeScript playground to demonstrate my issue. Is it feasible to achieve the desired result?