PostgreSql string arrays broken?

I’m trying to upgrade some of our projects from 4.0.40 to the latest in nuget (4.5.6).

Some of my unit tests rely on text[] columns in the PostgreSql data source, which are working fine on the old version, but do not seem to deserialize correctly anymore on the new version. Instead of an array of the values in the column, I get an array with a single value equal to System.String[]. The following is a sample program to reproduce the issue:

namespace OrmTest
{
    using System;
    using ServiceStack.DataAnnotations;
    using ServiceStack.OrmLite;
    using ServiceStack.Text;

    public class MyData
    {
        [PrimaryKey]
        public Guid Id { get; set; }

        [CustomField("int[]")]
        public int[] MyInts { get; set; }

        [CustomField("text[]")]
        public string[] MyStrings { get; set; }
    }

    class MainClass
    {
        public static void Main(string[] args)
        {
            var factory = new OrmLiteConnectionFactory("Host=localhost;Username=ormtest;Database=ormtest;Port=5432;", PostgreSqlDialect.Provider);

            using(var db = factory.OpenDbConnection())
            {
                db.CreateTableIfNotExists<MyData>();

                var newdata = new MyData
                {
                    Id = Guid.NewGuid(),
                    MyInts = new[] { 2, 4, 1 },
                    MyStrings = new[] { "test string 1", "test string 2" }
                };

                db.Save(newdata);

                var datas = db.Select<MyData>().ToArray();

                datas.PrintDump();
            }
        }
    }
}

The output shows that the int[] field is working as expected, but the text[] field no longer does:

[
        {
                Id: ec05c19d04dc43e0b0f562ff9c43a122,
                MyInts:
                [
                        2,
                        4,
                        1
                ],
                MyStrings:
                [
                        "System.String[

                        ]"
                ]
        }
]

Is there something wrong or missing in my code that needs to be fixed to get the text[] columns working again?

edit: I should note that the insert seems to work correctly, as when I manually check the data in PostgreSql it has the correct string array value in the my_strings column as expected.

I think per the release notes you should change your CustomField Attributes to the appropriate new PgSQL* attributes, e.g:

    [PgSqlIntArray]
    public int[] MyInts { get; set; }

    [PgSqlTextArray]
    public string[] MyStrings { get; set; }

Thanks, I missed those new attributes. However even after updating my example code with those I get the same result (int array works, string array gives me the unexpected System.String[] value).

Apologies, text[] support somehow got lost in a refactor, it should be fixed from this commit.

This fix is available from v4.5.7 that’s now available on MyGet.