Allow serializer attribute functions to have arity of 1 or 2.