{% if optional -%}
let {{ name }}_core: Option<Vec<_>> = {{ name }}.map(|strs| strs.into_iter().map(|s| serde_json::from_str::<_>(&s).map_err(|e| {{ error_expr }})).collect::<Result<Vec<_>, _>>()).transpose()?;
{%- else -%}
let {{ name }}_core: Vec<_> = {{ name }}.into_iter().map(|s| serde_json::from_str::<_>(&s).map_err(|e| {{ error_expr }})).collect::<Result<Vec<_>, _>>()?;
{%- endif %}
