假设我们在C#中有API返回模型
public class ApiResult<T>
{
public T Result;
public bool Success;
}
并将ApiResult<string>
对象实例返回给客户端
所以我们有swagger生成的模型
ApiResult[String] {
result (string, optional),
success (boolean, optional)
}
使用https://swagger.io/swagger-codegen/
错误地转换为typescript类'use strict';
import * as models from './models';
export interface ApiResultString {
result?: string;
success?: boolean;
}
是否可以使用与输入模型相同的泛型生成输出模型?