Closed MartinM85 closed 1 month ago
@baywet Out of the scope of this issue, but if the server returns collection of enums, the generated client code is
return await RequestAdapter.SendPrimitiveCollectionAsync<MyEnum?>(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false);
SendPrimitiveCollectionAsync
internally calls GetCollectionOfPrimitiveValues
https://github.com/microsoft/kiota-serialization-json-dotnet/blob/main/src/JsonParseNode.cs#L310 and it doesn't handle enums.
IParseNode
exposes GetCollectionOfEnumValues
and GetEnumValue
, but they have constraint for T
limited to enum. ModelType
doesn't have any constraint.
Transferring issue as part of https://github.com/microsoft/kiota-abstractions-dotnet/issues/238
I've an endpoint which returns enum (C#):
The generated code for
GetAsync
looks like this:But it throws InvalidOperationException with message error handling the response, unexpected type
I can't find any workaround for it right now