How to tell NSwag C# Client generator to use our DTOs instead of generating new ones?
Asked Answered
A

1

6

We currently have over 100 DTOs already well-designed in a separate assembly and span multiple namespaces. How can we instruct the NSwag C# client generator to utilize our existing DTO library instead of generating its own DTOs?

Averment answered 3/4, 2023 at 17:55 Comment(0)
A
7

I found it:

{
  "codeGenerators": {
    "openApiToCSharpClient": {
      "generateDtoTypes": false,
      "additionalNamespaceUsages": [
        "Your.DTOTypes.Namespace"
      ]
    }
  }
}
Averment answered 4/4, 2023 at 9:23 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.