Replies: 2 comments 4 replies
-
Js also has the same issue: export class GetContactsResponse extends Array {
/** @param {{payload?:T,responseStatus?:ResponseStatus}} [init] */
constructor(init) { super(init); Object.assign(this, init) }
} |
Beta Was this translation helpful? Give feedback.
0 replies
-
We don't support inheriting from nested generic types, change the DTO so the [DataContract]
public class Response<T>
{
[DataMember(Order=1)]
public List<T> Payload { get; set; }
[DataMember(Order=2)]
public ResponseStatus ResponseStatus { get; set; }
}
[DataContract]
public class GetContactsResponse
: Response<Contact>
{
} |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
C# DTOs:
Generated Typescript Code:
The response DTO
GetContactsResponse
should be extended fromResponse<Array<Contact>>
orResponse<Contact[]>
, notArray<Response<Contact>>
.Additionally, I tried to change List<> to IList<> or IEnumerable<>, but the automatically generated code type is also IList<> or IEnumerable<>. However, some languages do not have this type.
Beta Was this translation helpful? Give feedback.
All reactions