TypeScript DTO exclude namespace

I found a feature to include namespace for DTO generation:

Include All Types within a C# namespace
If your DTOs are grouped into different namespaces they can be all included using the /* suffix, e.g:

/* Options:
IncludeTypes: MyApp.ServiceModel.Admin/*
This will incllude all DTOs within the MyApp.ServiceModel.Admin C# namespace

But it seems this does not work for the ExcludeTypes;

Right, the include namespace wildcard is just for IncludeTypes.

Ok thx for confirming. Any chance to add it for ExcludeTypes as well?

No ExcludeTypes wildcards are too fragile/buggy to be able to generate DTOs without missing references.

Ow… mmm… I now have lots of duplicates because some libraries I included use the same class names; so I get duplicate on Recipient for example. How am I able to exclude App.Name1.Recipient but not App.Name2.Recipient ?

It’s not possible to distinguish Types by namespace, it’s recommended that all DTO types are unique which is required in many Add ServiceStack Reference supported languages.

There is a static TypeScriptGenerator.FilterTypes which you can use to filter types, but it’s static.

Ok, I understand the recommendation, but it is not always possible when you don’t control types - external libraries for SMS reception using the same class name, and there is a service as a callback that post for example the Recipient class.

You shouldn’t be relying on distinguishing Types by C# namespaces in your external Service Contracts which is why they’re not supported in languages without .NET namespaces. That’s why all DTOs should be unique if you want to use Add ServiceStack Reference feature.