Auto-serialise value if its an object or an array.