Reputation: 340
I'm wanting to use a shared DLL between my endpoint REST service and my client. Both are written in dotnet core.
I dont want the generated nswag c# to include these objects defined in the shared DLL but instead just reference them. This way I retain all the validation attributes/logic and can validate both on the server and the front end.
I tried using "Excluded Type Names", but thats not having any effect. Eg. my common dll namespace is "MyCommonLibrary" and theres an object of type "MyType" in there. I've tried "MyCommonLibrary.MyType" aswell as just "MyType" in that field, neither produced a C# generated file with that type missing (i.e. a new type was generated).
Say my REST call is
public MyType[] GetAll(){ ... }
I want the generated controllers to return MyCommonLibrary.MyType and not "MyGenreatedController.MyType".
Is there a way to do this?
I'm hoping to wildcard this, since myself and other developers will be continuing to add to this and wanting to generate the generated C# code as part of the build process.
Upvotes: 1
Views: 824
Reputation: 11868
This can be solved in this way:
Upvotes: 1