So I know you’re supposed to create unique request and response DTO names. But two questions:
-
Is there ANY WAY to get around this requirement? I’m incorporating service contracts from various teams and I can’t guarantee they’ll all be unique. Modular Monolith deployment, so we bring them all together to have a unified API.
-
It’s getting complicated in a DDD scenario with bounded contexts. The concept of a “User” is different from one context to the other, and telling each team to prefix the name with User is cumbersome
-
The same is happening with base classes. We have common functionality across DTOs in a given domain and often use a RequestBase base class. But one set of service models RequestBase is different from another’s. The issue is then when the types files are generated in C#, for example, it uses public partial classes, and the classes get combined, so even when the resulting Request DTO name is different, because of the base class, we have a conflict. The same is going to happen with enums and other types. The cascading effect is too great to have to prefix everything.
Looking for guidance on how to manage all this. Ultimately I could, for the most part, deploy them as separate microservices, each with their own OpenAPI definition and separate servicestack instance, etc, etc. I really don’t want to have to do that. I want a single unified experience for our APIs.
Anything I can do? Anything like including namespaces, or auto-prefixing on import, or disabling the auto-generated endpoint (/api/Get…) in favor of only explicit endpoints (which would have to follow through in /ui/… as well)?