Open marco-gallinari opened 5 years ago
Hi,
i'm using NSwag.MSbuild to generate TypeScript interfaces from C# Core classes, to be consumed in an Angular 6 library.
I'm generating from the following c# classes:
public class Parent { public Child Son { get; set; } } public class Child { public string Value { get; set; } }
using NSwag.MSBuild 11.20.1 I get this TypeScript output:
export interface Parent { son?: Son; } export interface Child { value?: string; } export interface Son { value?: string; }
while previously on version 11.17.6 i was getting the proper definition:
export interface Parent { son?: Child; } export interface Child { value?: string; }
NSwag is running on this configuration:
{ "runtime": "NetCore20", "swaggerGenerator": { "typesToSwagger": { "output": "core.swagger.json", "defaultPropertyNameHandling": "CamelCase", "assemblyPaths": [ "$(OutDir)Assembly.dll" ], "classNames": [ "MyNamespace.*" ] } }, "codeGenerators": { "swaggerToTypeScriptClient": { "wrapDtoExceptions": false, "typeStyle": "Interface", "generateDtoTypes": true, "input": "core.swagger.json", "output": "core.server.ts" } } }
Am I missing something in NSwag json?
Strange, can you post the swagger spec?
Please find below a sample project to reproduce the issue:
SwagTest.zip
Hi,
i'm using NSwag.MSbuild to generate TypeScript interfaces from C# Core classes, to be consumed in an Angular 6 library.
I'm generating from the following c# classes:
using NSwag.MSBuild 11.20.1 I get this TypeScript output:
while previously on version 11.17.6 i was getting the proper definition:
NSwag is running on this configuration:
Am I missing something in NSwag json?