Closed Frees closed 9 years ago
Yeah, that seems great. :+1:
I`ll try implement my idea
This is already supported. SuperObject implements the attributes SOName and SODefault. When using DBX there are the attributes JsonName and JsonDefault defined in DbxJsonUtils unit.
See the code inside TypesToTest.TAllTypes and the tests inside TestDbxJsonUnMarshal
TAllTypes = class
[SOName('renamed')]
[JsonName('renamed')]
fieldNameRenamed: String;
Maybe this could be improved. Maybe remove the duplicated attribute. Anyway, The docs should be improved to expose this feature.
Thanks.
Thanks Fabricio
Since Delphi 2010 available attributes http://docwiki.embarcadero.com/RADStudio/2010/en/Declaring_Custom_Attributes
We can use it for improve marshal/unmarshal
For example:
it'll be marshaled to (or unmarshal from)