I am trying to create a Component Template which functions in Retrofit mode. When I add the Publish Mappings
building block to the Component Template, attempting a render gives me the following message:
Cannot deserialize the current JSON object (e.g. {"name":"value"}) into type 'System.Collections.Generic.List`1[Sdl.Web.Common.Models.Data.SummaryData]' because the type requires a JSON array (e.g. [1,2,3]) to deserialize correctly. To fix this error either change the JSON to a JSON array (e.g. [1,2,3]) or change the deserialized type so that it is a normal .NET type (e.g. not a primitive type like integer, not a collection type like an array or List) that can be deserialized from a JSON object. JsonObjectAttribute can also be added to the type to force it to deserialize from a JSON object.
Sure enough, the Output generated by the Render Component Content
is a JSON object (thus, not an array) that looks like this:
{
"Component":{<<Content here>>},
"ComponentTemplate":{<<CT details here>>},
"IsDynamic":true,
"OrderOnPage":0
}
I've tried putting Publish Mappings
at various locations in the pipeline, but it doesn't help.
What am I doing wrong?