want:=`{"summary":"Showers are possible during the selected day.","forecast_discussion":["A front will keep rain chances in the forecast.","Temperatures stay seasonable by afternoon."],"precipitation_timing":"Rain is most likely during the afternoon."}`
want:=`{"summary":"Showers are possible during the selected day.","forecast_discussion":["A front will keep rain chances in the forecast."],"precipitation_timing":""}`
in:`{"summary":"Showers are possible during the selected day.","forecast_discussion":["A front will keep rain chances in the forecast."],"extra":"value"}`,
want:`unknown field "extra"`,
},
{
name:"missing summary",
in:`{"forecast_discussion":["A front will keep rain chances in the forecast."]}`,
want:"summary is required",
},
{
name:"blank summary",
in:`{"summary":" ","forecast_discussion":["A front will keep rain chances in the forecast."]}`,
want:"summary is required",
},
{
name:"missing forecast discussion",
in:`{"summary":"Showers are possible during the selected day."}`,
want:"forecast discussion is required",
},
{
name:"blank forecast discussion",
in:`{"summary":"Showers are possible during the selected day.","forecast_discussion":[" ",""]}`,
want:"forecast discussion is required",
},
{
name:"forecast discussion wrong type",
in:`{"summary":"Showers are possible during the selected day.","forecast_discussion":"A front will keep rain chances in the forecast."}`,
want:"cannot unmarshal string",
},
{
name:"multiple values",
in:`{"summary":"Showers are possible during the selected day.","forecast_discussion":["A front will keep rain chances in the forecast."]} {}`,