Closed tjoubert closed 1 year ago
@DiscoPYF , @rossmills99 , I have just fixed a test that apparently was expecting the property names of objects that are dictionary item values to remain the same (i.e. DontCamelCaseMe => "DontCamelCaseMe"). See https://github.com/ArangoDB-Community/arangodb-net-standard/pull/401/commits/65705d15a1ac5533432b6a4b55a8f5ae35eda8fd
So was this a feature by design? If yes, then maybe what I should do is add a new option to ApiClientSerializationOptions
(something like public bool CamelCasePropertyNamesOfDictionaryValues { get; set; }
) which will be false by default.
DictionaryValueConverter.WriteJson()
will then initialize its local serializer with all the specified options only when CamelCasePropertyNamesOfDictionaryValues = true
. What do you think?
@tjoubert Yes, I think it was by design. Basically we wanted the serializer to not touch object passed as bind variables to the Cursor or Transaction API.
Your suggestion makes sense to me at a glance. 👍 It would also give more control to callers whenever they want to camelCase bind variables objects, e.g. when inserting a new document with the cursor API, which isn't possible at the moment unless they modify the serializer or use a JsonProperty
attribute.
I've added the option property and called it CamelCasePropertyNamesOfObjectValuesInDictionaries
.
It is false by default to maintain backward compatibility with the old default behavior.
@DiscoPYF , can you take another look please? :-) Thanks
Solved Issue #400 Amended the code to pass ApiClientSerializationOptions to DictionaryValueConverter