Skip to content

Commit

Permalink
patch deserialization bug in 2.13.1
Browse files Browse the repository at this point in the history
  • Loading branch information
davidmrdavid committed Feb 16, 2024
1 parent 4d39df9 commit 32c2e65
Showing 1 changed file with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -127,13 +127,17 @@ internal object GetInput(Type destinationType)

string serializedValue = jToken.ToString(Formatting.None);

// Object inputs for out-of-proc activities are passed in their JSON-stringified form with a destination
// type of System.String. Unfortunately, deserializing a JSON string to a string causes
// MessagePayloadDataConverter to throw an exception. This is a workaround for that case. All other
// inputs with destination System.String (in-proc: JSON and not JSON; out-of-proc: not-JSON) inputs with
// destination System.String should cast to JValues and be handled above.)
if (this.rawInput)

if (this.rawInput) // the "modern" OOProc protocol case
{
return serializedValue;
}
else if (destinationType.Equals(typeof(string))) // legacy OOProc protocol case (JS, Python, PowerShell)
{
// Object/complex inputs in "legacy" out-of-proc activities are passed with a destination
// type of System.String (to be precise, if inspected with a debugger, you'll see a stringified JSON).
// Unfortunately, deserializing a JSON string to a string causes MessagePayloadDataConverter to throw an exception, so the
// return statement prevents that.
return serializedValue;
}

Expand Down

0 comments on commit 32c2e65

Please sign in to comment.