Open Janath opened 3 years ago
I think happens due to GraphAuthClient default system text json settings. Old version works properly with newtonsoft settings
Update nugets to the latest version and use below snippet to correct serialization problem (Bot.cs constructor):
// graph client
var productInfo = new ProductInfoHeaderValue(
typeof(Bot).Assembly.GetName().Name,
typeof(Bot).Assembly.GetName().Version.ToString());
JsonSerializerOptions jsonSerializerOptions = new();
jsonSerializerOptions.Converters.Add(new JsonStringEnumConverter(JsonNamingPolicy.CamelCase, false));
GraphApiClient = new GraphAuthClient(
GraphLogger,
jsonSerializerOptions, // replaced Serializer.JsonSerializerSettings,
new HttpClient(),
AuthenticationProvider,
productInfo,
defaultProperties);
The serialized result will be:
{
"@odata.type": "#microsoft.graph.callAnswerRequestBody",
"callbackUri": "https://xxxxxxxxxxxx/api/callback",
"mediaConfig": {
"@odata.type": "#microsoft.graph.serviceHostedMediaConfig",
"preFetchMedia": []
},
"acceptedModalities": [
"Audio"
]
}
Any call with the above payload will return a 202 (Accepted) code.
@bogdandynamic Thanks
I'm also facing the same issue, can you please suggest how to update to the latest version of the nugets, since the target framework is .netcore2.1 and that doesn't allow the nugets to be updated to the latest version @bogdandynamic @Janath
@Amogh24, just edit the .csproj file of the project you want to update and change
<PropertyGroup>
<TargetFramework>netcoreapp2.1</TargetFramework>
</PropertyGroup>
with
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
</PropertyGroup>
After that, run Nuget Package Manager and update all packages.
Thanks for your help @bogdandynamic
Stateless samples generate json with reference data after upgrade to the latest package. Anyone know how to sort this out?
Expected Request
Actual Request