Home > Back-end >  Json string contains a colon (:), causing the Gson parse error, what should I do
Json string contains a colon (:), causing the Gson parse error, what should I do

Time:01-27

I am getting to the Json string from the server, and error when using Gson into objects, tip:

 
Com. Google. Gson. JsonSyntaxException: com. Google. Gson. Stream. MalformedJsonException: Unterminated object...


After a search, found that you have a value in the Json string contains a colon (:)

Json as follows (for too long, so part of the omitted) before and after:
 
Omitted,,,
{
"ObjectId" : "bf3d3b24e95447d6866c342a39361588,"
"ImageId" : "96 bdfa7aaddd4b40848ddcf02266308c",
"Sha1" : "25031 f31f939fe79bf60eddbf0cd37e41929501f",
"FileCategory" : "e55ec864ba2344cea3dcafc2781e3fe5,"
"OriginalFileName" : "9 c77a79c4ef643f3ab386cfee59f64c6_https:www.lgstatic.com iimageM008FDCCgqCHmAJKSSAezOCAAQlPl9R - Rw735. JPG",
"SourceFileName" : "895 e48fa61b24573b8cb2f177d52570a_1611496313610. JPG",
"CoverFileName" : "d35d3357e17e46a4a205cc930fbdc693_1611496313611. JPG",
"ThumbnailFileName" : "c8b80504c5ab4e84a8e3b73e1982dcae_1611496313611. JPG",
"CreateTime" : 1611412660000,
"ImageUser" : "84 f6e0d8d94348ccab981e364661a419",
1
"imageStatus" :}
Omitted,,,

Is that the key is originalFileName error caused by the value of (... HTTPS:... Colon), be removed can normal parsing, but can't modify original data again, should I do excuse me this kind of situation?
  • Related