Situation: I have multiple Web service API calls that deliver object structures. Currently, I declare explicit types to bind those object structures together. F
You have a little bid conflicting requirements
Question:
I have loads of these custom classes like
MyType
and would love to use a generic container instead
Comment:
However, what type would I have to declare in my ProducesResponseType attribute to explicitly expose what I am returning
Based on above - you should stay with types you already have. Those types provide valuable documentation in your code for other developers/reader or for yourself after few months.
From point of readability
[ProducesResponseType(typeof(Trip), 200)]
will be better then
[ProducesResponseType(typeof((double speed, int distance)), 200)]
From point of maintainability
Adding/removing property need to be done only in one place. Where with generic approach you will need to remember update attributes too.