Attribute type and formatter in serialization