When the Convert tries to Deserialize Luis Result object, it crashes with this exception:
Newtonsoft.Json.JsonSerializationException: 'Error converting value "blanco" to type 'Microsoft.Bot.Builder.AI.Luis.DateTimeSpec'. Path 'entities.datetime[0]', line 20, position 14.'
Inner Exception
ArgumentException: Could not cast or convert from System.String to Microsoft.Bot.Builder.AI.Luis.DateTimeSpec.
The input comes with an entity, type datetime, that has no resolution:
"entities": [
{
"entity": "blanco",
"type": "builtin.datetimeV2.date",
"startIndex": 0,
"endIndex": 5
}
]
In Spanish we can say "la noche en blanco" referring to a holiday, thus LUIS detects it fine but it has no resolution day, https://github.com/microsoft/Recognizers-Text/blob/26d2020b19c12c3f30e22d4a11bfe1d4304fc1ed/JavaScript/packages/recognizers-date-time/src/resources/spanishDateTime.ts#L170
In my case, this issue can be solved if the JsonConvert.DeserializeObject method is called with an error event handler defined in the JsonSerializerSettings:
var app = JsonConvert.DeserializeObject<GoioLuisModel>(
JsonConvert.SerializeObject(result,
new JsonSerializerSettings {
NullValueHandling = NullValueHandling.Ignore
}),
new JsonSerializerSettings
{
Error = HandleDeserializationError
});
Would it has any sense to include an error handler in the generated source code by the converter?
When the Convert tries to Deserialize Luis Result object, it crashes with this exception:
The input comes with an entity, type datetime, that has no resolution:
In Spanish we can say "la noche en blanco" referring to a holiday, thus LUIS detects it fine but it has no resolution day, https://github.com/microsoft/Recognizers-Text/blob/26d2020b19c12c3f30e22d4a11bfe1d4304fc1ed/JavaScript/packages/recognizers-date-time/src/resources/spanishDateTime.ts#L170
In my case, this issue can be solved if the JsonConvert.DeserializeObject method is called with an error event handler defined in the JsonSerializerSettings:
Would it has any sense to include an error handler in the generated source code by the converter?