We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I've an endpoint which returns enum (C#):
return Ok(MyEnum.Value1);
The generated code for GetAsync looks like this:
GetAsync
return await RequestAdapter.SendPrimitiveAsync<MyEnum?>(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false);
But it throws InvalidOperationException with message error handling the response, unexpected type
I can't find any workaround for it right now
The text was updated successfully, but these errors were encountered:
@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.
SendPrimitiveCollectionAsync
GetCollectionOfPrimitiveValues
IParseNode exposes GetCollectionOfEnumValues and GetEnumValue, but they have constraint for T limited to enum. ModelType doesn't have any constraint.
IParseNode
GetCollectionOfEnumValues
GetEnumValue
T
ModelType
Sorry, something went wrong.
Transferring issue as part of #238
MartinM85
Successfully merging a pull request may close this issue.
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
The text was updated successfully, but these errors were encountered: