Allow custom JsonSerializerSettings to be provided to a HostingModel #1462

Closed
opened 2025-08-09 17:20:14 +00:00 by fergalmoran · 0 comments
Owner

Originally created by @bradchristensen on 8/1/2016

Currently in my application I don't want to use the CamelCasePropertyNamesContractResolver when serialising JSON to and from the Node.js process, but this is a readonly setting in each of the existing HostingModels (see f2f67fe880/src/Microsoft.AspNetCore.NodeServices/HostingModels/HttpNodeInstance.cs (L29)). It threw me that this was the default behaviour, although I don't think it's a bad thing. We should be migrating our app to use it in future.

I'm not familiar with how everything fits together so I can't propose any implementational details but would be interested to know if it would be a possibility to make this configurable when instantiating a HostingModel. Or is it expected that a custom HostingModel should be created to configure this?

*Originally created by @bradchristensen on 8/1/2016* Currently in my application I don't want to use the CamelCasePropertyNamesContractResolver when serialising JSON to and from the Node.js process, but this is a readonly setting in each of the existing HostingModels (see https://github.com/aspnet/JavaScriptServices/blob/f2f67fe880dc78e7aa07c89f2dff0c76c7993cb7/src/Microsoft.AspNetCore.NodeServices/HostingModels/HttpNodeInstance.cs#L29). It threw me that this was the default behaviour, although I don't think it's a bad thing. We should be migrating our app to use it in future. I'm not familiar with how everything fits together so I can't propose any implementational details but would be interested to know if it would be a possibility to make this configurable when instantiating a HostingModel. Or is it expected that a custom HostingModel should be created to configure this?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github/JavaScriptServices#1462
No description provided.