Hi Alexander,
Unless I am missing a cool trick, you can't do this directly...
Property DateOfBirth As %Date(JSONNAME = "BirthDate");
you would need to extend %Date with your own class type and add the JSONNAME parameter to it, which means you end up with...
Property DateOfBirth As Cogs.Lib.Types.Date(JSONNAME = "BirthDate");
Which for me feels much more cumbersome, not to mention that developers are forced to change all of their existing code as well as amend any existing overriden data types that they use.
Unless I am missing another trick, I'm pretty sure you can't add these attributes to complex types which if I am right is a show stopper anyway.
Annotations are just much easier to work with, I need them for methods as well so it just seems more in keeping to do it all this way.
Sean.
- Log in to post comments