exceptionless / Exceptionless.Net

Exceptionless clients for the .NET platform
https://exceptionless.com
Other
557 stars 142 forks source link

Preserving custom object property names sent to SetProperty and AddObject #294

Closed niemyjski closed 1 year ago

niemyjski commented 1 year ago

Currently we change the casing of custom data to our snake case formatting. We should try to preserve the object as it is as the model not owned by us.

Currently we are using our serializer settings and applying it to SetProperty and AddProperty and not preserving names. Short term If you want to use the DataMember attributes to control naming we will respect those. You could also define the [Exceptionless.Json.JsonProperty("name")] attribute as a temporary short-term fix.

We are going to look into possibly creating some new serializer settings for this, but in the meantime feel free to serialize this yourself and stick the serialized string json as the value like this SetProperty("response data", json)

niemyjski commented 1 year ago

@ejsmith do you have any preferences on this? Really seems like we need to special case all unknown data keys and use a standard serializer with no name changes?

ejsmith commented 1 year ago

Yeah, agree that we should not be changing the actual JSON data names and only doing that for display purposes as we are rendering. When we do show JSON source in the UI, it should look identical to what they sent us.