title: NSwag generating duplicate types
body: <p>I am using NSwag SwaggerToCSharpClientGenerator to generate the request and response classes and enums.</p>
  
  <p>I have some Web API methods that share the same enum as an argument or as part of request object.  When I run the NSwag API, it generates the same enum definition multiple times, but named as Enum1, Enum2, Enum3, ResponseClassEnum.</p>
  
  <p>Can I configure NSwag (or Swashbuckle) so that only one enum is generated?</p>
  
  <p>My NSwag code looks like:</p>
  
  <pre><code>   var document = SwaggerDocument.FromUrlAsync(
        "http://localhost:5003/swagger/v1/swagger.json").Result;
  
     var settings = new SwaggerToCSharpClientGeneratorSettings();
     settings.GenerateClientClasses = false;
     settings.CSharpGeneratorSettings.Namespace = "My.Interface";
     settings.CSharpGeneratorSettings.ArrayType = "List";
     settings.AdditionalNamespaceUsages = new string[] { "System.Collections.Generic" };
     settings.GenerateExceptionClasses = false;
  
     var generator = new SwaggerToCSharpClientGenerator(document, settings);
  
     var code = generator.GenerateFile();
     File.WriteAllText("Swagger.MyApi.cs", code);
  </code></pre>
  
  <p>I have put obfuscated swagger.json here - 
  <a href="https://pastebin.com/hT5ySZub" rel="nofollow noreferrer">https://pastebin.com/hT5ySZub</a></p>
  
  <p>Produced output from obfuscated swagger.json is here -
  <a href="https://pastebin.com/e0AYJWer" rel="nofollow noreferrer">https://pastebin.com/e0AYJWer</a>
  In the output, the type DupEnum is defined in types: DupEnum, DupEnum2, DupEnum3, and TypeBDupEnum.</p>