Assume we have API return model in C#
public class ApiResult<T>
{
public T Result;
public bool Success;
}
and returning ApiResult<string>
object instance to client
so we have swagger generated model
ApiResult[String] {
result (string, optional),
success (boolean, optional)
}
which is incorrectly converted to typescript class using https://swagger.io/swagger-codegen/
'use strict';
import * as models from './models';
export interface ApiResultString {
result?: string;
success?: boolean;
}
Is it possible to generate output models with generics same as in input models?
I have created issue on swagger-codegen on GitHub . You can support this feature there. Looks like currently it is not possible.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With