Let's consider a scenario where we receive an API return model in C#
public class ApiResult<T>
{
public T Result;
public bool Success;
}
and send back an ApiResult<string>
object instance to the client
This leads us to a swagger generated model:
ApiResult[String] {
result (string, optional),
success (boolean, optional)
}
Unfortunately, this model is incorrectly converted into a typescript class using
'use strict';
import * as models from './models';
export interface ApiResultString {
result?: string;
success?: boolean;
}
The question now arises: Can we generate output models with generics matching those in the input models?