We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NSwag.AspNetCore 14.0.8 Repo for reproduction: https://github.com/varganatt/NSwagRepro/blob/master/NSwagRepro.csproj Settings: nswag.json
14.0.8
When you have a type that contains nested data, and generate both TypeScript classes and interfaces, the interfaces reference nested class data.
Interfaces should never reference generated classes.
I have an endpoint that returns nested data (NestedData.cs):
public class NestedData { public InnerDetails Details => new(); public class InnerDetails { public int SomeValue { get; set; } } }
From the generated TypeScript code:
export class NestedData implements INestedData { // Implementation } export interface INestedData { details?: InnerDetails; // <--- THE PROBLEM } export class InnerDetails implements IInnerDetails { // Implementation } export interface IInnerDetails { someValue?: number; }
INestedData.details should be specified as the type IInnerDetails, not InnerDetails.
INestedData.details
IInnerDetails
InnerDetails
The text was updated successfully, but these errors were encountered:
No branches or pull requests
NSwag.AspNetCore
14.0.8
Repo for reproduction: https://github.com/varganatt/NSwagRepro/blob/master/NSwagRepro.csproj
Settings: nswag.json
When you have a type that contains nested data, and generate both TypeScript classes and interfaces, the interfaces reference nested class data.
Interfaces should never reference generated classes.
I have an endpoint that returns nested data (NestedData.cs):
From the generated TypeScript code:
INestedData.details
should be specified as the typeIInnerDetails
, notInnerDetails
.The text was updated successfully, but these errors were encountered: