Below is the piece of my code which is throwing ex two exception in this line and I have no clue whats wrong in here.
Exceptions thrown are:
- JsonReaderException: Input string '08' is not a valid number. Path 'Ape', line 1, position 51.
- FormatException: Additional non-parsable characters are at the end of the string.
The Json which I am deserializing line by line is as follows:
{"PartitionKey": "test","RowKey": "first","Ape": 06,"Nepe": "depe","EPA": 323,"Time": "04/23/2012 18:25:43","bits": "test"}
{"PartitionKey": "test","RowKey": "Second","Ape": 107,"Nepe": "TNepe","EPA": 23,"Time": "04/22/2012 18:25:43","bits": "Ttest"}
{"PartitionKey": "test","RowKey": "Third","Ape": 08,"Nepe": "TNepe","EPA": 34,"Time": "04/20/2020 18:25:43","bits": "Jtest"}
There is no problem in reading first two line but error happens at third/last line. I am not sure as what is wrong as I made sure no extra space in middle or end of line and 'Ape' key is of type integer.
here is my code>, the error occurs at Deserializing Json Object. Find the value passed in line before error occurs in the screen shot>
foreach( var line in lines )
{
var data = JsonConvert.DeserializeObject<JObject>( line );
var errors = validator.Validate( data, schema );
if( errors.Count() > 0 )
{...
Please let me if one knows whats wrong and the fix required. Thanks