Closed
Description
Issue
AF returning JsonResult with JsonSerializerSettings (StringEnumConverter, NullValueHandling = NullValueHandling.Ignore) instance passed through its constructor throws an exception.
Investigative information
- Function App version: 3.0
- Function App runtime: .Net Core 3.1
Repro steps
https://github.com/HMoen/FunctionApp-JsonResult-Error/
Expected behavior
{
"Status": "Pending",
"WithValue": "Has value"
}
Actual behavior
Throws exception: Microsoft.AspNetCore.Mvc.NewtonsoftJson: Property 'JsonResult.SerializerSettings' must be an instance of type 'Newtonsoft.Json.JsonSerializerSettings'
Removing the passed JsonSerializerSettings in JsonResult:
{
"status": 0,
"withValue": "Has value",
"nullValue": null
}
Known workarounds
- Add Nuget Microsoft.AspNetCore.Mvc.NewtonsoftJson to your poject
- Add the following in local.settings.json and Azure App Settings: "FUNCTIONS_V2_COMPATIBILITY_MODE": true
Related information
Metadata
Metadata
Assignees
Labels
No labels