1

I have a shared library between my client and my server.

It doesn't contain much, keeping it as small as possible. However all my enums are stored in this shared library.

I do this because some of my shared functions need to know/use the enums.

When I generate my c# using NSwagStudio I get a reference error saying my enums are defined twice. Once in the shared library and once in the generated code.

Can I tell NSwag to using my shared library for types and not auto generate them?

reven
  • 330
  • 4
  • 14

1 Answers1

0

You can exlude some types from being generated with the ExludedTypeNames setting

https://github.com/RSuter/NJsonSchema/blob/master/src/NJsonSchema.CodeGeneration/CodeGeneratorSettingsBase.cs#L30

Rico Suter
  • 11,548
  • 6
  • 67
  • 93