FYI I’ve just added the ability to define different aliases for return types in this commit where a byte[] array property will be generated to use string to capture its Base64 string returned in JSON APIs whilst if the entire response is binary, e.g. returns byte[] or Stream it will be generated to use a Blob type, e.g. the C# Request DTO with a byte[] property and Return Type:
public class ReturnBytes : IReturn<byte[]>
{
public byte[] Data { get; set; }
}
Will generate the following TypeScript DTO:
export class ReturnBytes implements IReturn<Blob>
{
public data: string;
public constructor(init?: Partial<ReturnBytes>) { (Object as any).assign(this, init); }
public createResponse() { return new Blob(); }
public getTypeName() { return 'ReturnBytes'; }
}
This change is available in the latest v5.11.1 that’s now available on MyGet.
Thanks for the quick response. In our case the byte[] was the return type. I think your last adjustment is very good and fits most scenarios. But I also love the flexibility, so we can customize it according to our needs.