Web Connection
255 character limit with Deserialize?
Gravatar is a globally recognized avatar based on your email address. 255 character limit with Deserialize?
  Bob Roenigk
  All
  Apr 30, 2021 @ 12:51pm

I am using wwJsonSerializer to Deserialize an incoming JSON message. It appears there is a 255 character limit due to crashing with an "unexpected character" error when longer than that.

Is that the correct design limit?

~bob

Gravatar is a globally recognized avatar based on your email address. re: 255 character limit with Deserialize?
  Rick Strahl
  Bob Roenigk
  Apr 30, 2021 @ 01:13pm

No that shouldn't be a problem. Got sample JSON? Is that the entire JSON string or a key value being longer?

Make sure you're using the full deserialization routine, and not the really old one. If you're on an older version use DeserializeJson() not Deserialize(). In recent versions Deserialize() just calls DeserializeJson() but in older versions those were two different parsers. The old one (Fox based code) should not be used.

+++ Rick ---

Gravatar is a globally recognized avatar based on your email address. re: 255 character limit with Deserialize?
  Marcel DESMET
  Bob Roenigk
  May 1, 2021 @ 11:57am

Hello Bob, just my 2 cents JSON does not allow real line-breaks..

Gravatar is a globally recognized avatar based on your email address. re: 255 character limit with Deserialize?
  Rick Strahl
  Bob Roenigk
  May 1, 2021 @ 01:29pm

FWIW - if you're getting unexpected character, that sounds more like invalid JSON. Make sure the JSON you are deserializing is valid. Note that JSON text needs to be encoded - linebreaks, quotes, lower ascii chars and a bunch of other things need to be encoded or the JSON is not valid.

+++ Rick ---

Gravatar is a globally recognized avatar based on your email address. re: 255 character limit with Deserialize?
  Bob Roenigk
  Rick Strahl
  May 2, 2021 @ 08:16am

This turns out to NOT be a Deserialize issue. The third-party client is truncating the message body to 256 characters before transmitting.

Thanks

© 1996-2021