Azure / Azure/azure-functions-openapi-extension
Using JsonSerializerSettings with JsonResult Causes Error
- Dominant language
- C#
- Stars
- 388
- Forks
- 202
- PR merge metrics
- No merged PRs in 30d
Description
After installing this package, all my functions that had JsonSerializerSettings in the return failed and the method can't be found.
`return new JsonResult(info, new JsonSerializerSettings
{
Formatting = Formatting.Indented
});`
This causes the following error after running this GET method
_System.Private.CoreLib: Exception while executing function: MyFunction. My.Functions: Method not found: 'Void Microsoft.AspNetCore.Mvc.JsonResult..ctor(System.Object, Newtonsoft.Json.JsonSerializerSettings)_
If I remove the JsonSerializerSettings from the return method then the method works fine. This was working before installing the package so not sure if it is directly this package causing the issue or a dependency.
This is using an InProc Version 4 Azure Function using .NET 6 with the latest libraries.
Contributor guide
Assessment
This issue has not been assessed yet.