keep custom attributes when serializing enum and *Of