Check out this StackBlitz Example
Issue:
How can I have Foo without Bar, or both, but still give an error for anything else?
The TypeScript warning is causing confusion...
https://i.stack.imgur.com/klMdW.png
index.ts
https://i.stack.imgur.com/VqpHU.png
service.ts
https://i.stack.imgur.com/bsyjp.png
serviceConfig.ts
https://i.stack.imgur.com/GuFbP.png
I suspect that my Service Method - dataWithValidKeys: { [key in validKeys]: any } might be incorrect