pyscripter 749 Posted Tuesday at 07:11 PM (edited) When I serialize a an object with object fields that are nil I get null values in the Json result e.g. { "capabilities": { "positionEncoding": [], "textDocumentSync": { "openClose": true, "change": 2, "willSave": false, "willSaveWaitUntil": false, "save": null }, "notebookDocumentSync": null, "completionProvider": null, } How can I ignore fields that have nil values? System.JSON.Types defines the following: TJsonDefaultValueHandling = (Include, Ignore, Populate, IgnoreAndPopulate); but it is not used anywhere. I also tried to use a converter, but I could not get it to work. And in any case converters are used after the property name is written. Any ideas? Edited Tuesday at 09:29 PM by pyscripter Share this post Link to post
pyscripter 749 Posted Wednesday at 07:33 PM Feature requests added: TJSONSerializer support for Null value and default value handling. - RAD Studio Service - Jira Service Management Add an overload to TJSONSerializer, that serializes without using converters - RAD Studio Service - Jira Service Management Share this post Link to post
aehimself 404 Posted 7 hours ago Does TJSonSerializer work with TObjectList and TObjectDictionary already? As far as I remember this is why I started to (de)serialize objects manually back around Delphi 10.4 but would love to automate things finally :) Share this post Link to post
pyscripter 749 Posted 7 hours ago (edited) 29 minutes ago, aehimself said: Does TJSonSerializer work with TObjectList and TObjectDictionary already? As far as I remember this is why I started to (de)serialize objects manually back around Delphi 10.4 but would love to automate things finally 🙂 It includes a number of converters to handle generic collections, but I think you have to add them manually: Edited 7 hours ago by pyscripter Share this post Link to post