Subject: | Error on scalar value |
Defined a value in DBIX class with:
__PACKAGE__->load_components("InflateColumn::Serializer","Core");
__PACKAGE__->table("testing");
__PACKAGE__->add_columns(
'id' => {},
'test' => {'serializer_class' => 'JSON',
'serializer_options' => {'allow_nonref' => 1 }},
__PACKAGE__->set_primary_key("id");
Assigning test to any sort of hash or array works great. However if test is a scalar the value will get stored in the database but when you try to retrieve its value I get this error:
malformed JSON string, neither tag, array, object, number, string or atom, at character offset 0 (before "Fill") at /usr/local/share/perl5/DBIx/Class/InflateColumn/Serializer/JSON.pm line 91.
In the above error the value for test in the database is "Fill" however I think the proper JSON value for decoding in the database would have to be ""Fill"" we need the quotes in the database for JSON to restore it properly.
$ perl -v
This is perl 5, version 16, subversion 3 (v5.16.3) built for x86_64-linux-thread-multi
(with 29 registered patches, see perl -V for more detail)
$ perl -MDBIx::Class::InflateColumn::Serializer::JSON -e 'print "$DBIx::Class::InflateColumn::Serializer::JSON::VERSION\n"'
0.08