On the other hand, it would be great if there could be a way to set a "non-strict mode", where the found properties are mapped, and the ones that does not belong to the class could be just ignored.
This is because we have a set of common fields that are using for our system, but the sources of the csv could contain some more fields, sometimes it does not include all the fields.
Newtonsoft does the right thing filling the properties that finds, leaving the others alone, is there a reason why the behavior is not like this?
If i generate a string field with comas, it can be serialized fine:
With this class
And this data:
The write controller gets the right output:
But, inserting the same test in a request gives the error:
If i remove the ",", everything works fine again.
Of course i had to change my config to use commas as separators:
On the other hand, it would be great if there could be a way to set a "non-strict mode", where the found properties are mapped, and the ones that does not belong to the class could be just ignored.
This is because we have a set of common fields that are using for our system, but the sources of the csv could contain some more fields, sometimes it does not include all the fields.
Newtonsoft does the right thing filling the properties that finds, leaving the others alone, is there a reason why the behavior is not like this?