You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would expect that the Id field would get deserialized into the additional_properties and id would be deserialized to just id_serialized_name. The alternative is to not try and mix dynamic and static model types and just make the entire object dynamic (everything is a Map<String, Object>)
When reporting a bug, please be sure to include the following
SDK version - 1.0
Steps to reproduce
Expected behavior
Actual behavior
The text was updated successfully, but these errors were encountered:
I took a quick look at this to try and get a fix in for the upcoming release but don't see a quick solution at the moment. The section where the code fails is after calling the built-in JSON.deserialize() method, so I think fixing this would take writing some custom deserialization logic similar to how we've done in other places.
I'll leave this issue open for now as a reminder to maybe look at it in the future (and because I do agree it's a problem), but right now it's just a big limitation of the language that I'm not going to prioritize.
JSON deserialization for models using
IBMWatsonDynamicModel
fails when JSON object keys are case insensitive.The following Apex code can be run and errors out with:
System.JSONException: Duplicate field: IBMDiscoveryV1Models.QueryResult.id_serialized_name
I would expect that the
Id
field would get deserialized into theadditional_properties
andid
would be deserialized to justid_serialized_name
. The alternative is to not try and mix dynamic and static model types and just make the entire object dynamic (everything is aMap<String, Object>
)When reporting a bug, please be sure to include the following
The text was updated successfully, but these errors were encountered: