I've got an azure functions project that takes in an object that has a dynamic property, stores it into cosmos and reads that same object out and returns it as JSON from a HTTPTrigger. Since upgrading to V3 my dynamic property is now malformed in the response.
The sections property is type dynamic and as you can see every property is being returned as an empty array. The nested properties "name", "prompt", "type", etc should be strings, not arrays. The primitive values on the root object serialize fine.
If I downgrade back to functions V2 the JSON serialization works properly I haven't found any documentation that explicitly states that V3 uses the new system.text.json classes I know ASP.Net core has and as AZ Functions is built on top of it's likely it has as well. So my guess is this problem is related to the following: https://github.com/dotnet/corefx/issues/38007.
Seeing as Microsoft doesn't plan to support dynamics in System.Text.Json anytime soon we need a way to switch back to NewtonsoftJson. In ASP.Net core you can switch back by adding services.AddControllers().AddNewtonsoftJson() to Startup. It would be helpful for Azure Functions to have some equivalent.
same issue here but using dynamic as type to proxy response (from API called by function) to frontend application, don't really care for creating API response specific model, dynamic is (should be!) just fine!
I've got an azure functions project that takes in an object that has a dynamic property, stores it into cosmos and reads that same object out and returns it as JSON from a HTTPTrigger. Since upgrading to V3 my dynamic property is now malformed in the response.
The sections property is type dynamic and as you can see every property is being returned as an empty array. The nested properties "name", "prompt", "type", etc should be strings, not arrays. The primitive values on the root object serialize fine.
If I downgrade back to functions V2 the JSON serialization works properly I haven't found any documentation that explicitly states that V3 uses the new system.text.json classes I know ASP.Net core has and as AZ Functions is built on top of it's likely it has as well. So my guess is this problem is related to the following: https://github.com/dotnet/corefx/issues/38007.
Seeing as Microsoft doesn't plan to support dynamics in System.Text.Json anytime soon we need a way to switch back to NewtonsoftJson. In ASP.Net core you can switch back by adding
services.AddControllers().AddNewtonsoftJson()
to Startup. It would be helpful for Azure Functions to have some equivalent.