title: NSwag & Extension Code - How to ensure it's placed at the start of the file?
body: <p>I have an ASP.Net Core 3.1 backend, and a Typescript 3.8 front end.</p>
  
  <p>I'm attempting to tell NSwag to inject authorization headers, as per this page in the documentation: <a href="https://github.com/RicoSuter/NSwag/wiki/TypeScriptClientGenerator#inject-an-authorization-header" rel="nofollow noreferrer">https://github.com/RicoSuter/NSwag/wiki/TypeScriptClientGenerator#inject-an-authorization-header</a></p>
  
  <p>(My <code>extensionCode</code> file is, exactly, what's provided there)</p>
  
  <p>When NSwag builds my output TypeScript file, however, my <code>extensionCode</code> is places at the <em>bottom</em> of the file. That means that the classes generated above can't reference it, and I get TypeScript compilation errors. If I manually move my code to the top, it works.</p>
  
  <p>I see in the NSwag code that  there seems to be a way to get the extension code to render at the top as expected, and it seem to do with <code>extendedClasses</code>, but for the life of me I can't get it to work. I've also tried adding <code>extends generated.[Class Name]</code> as described in a couple places, but that didn't help either (or, more likely, I was doing it wrong).</p>
  
  <p>Does anyone have any suggestions for how I can get this working?</p>
  
  <p><strong>Edit:</strong> Almost forgot, here's a link to my nswag.json file: <a href="https://gist.github.com/mattgrande/075f05177191bf8daffbf51609e40267" rel="nofollow noreferrer">https://gist.github.com/mattgrande/075f05177191bf8daffbf51609e40267</a></p>