Skip to content

Commit

Permalink
CP-53003: Use JsonRpc v1.0 by default and switch to v2.0 once the API…
Browse files Browse the repository at this point in the history
… version is known.

Signed-off-by: Konstantina Chremmou <[email protected]>
  • Loading branch information
kc284 committed Jan 6, 2025
1 parent ad4f3d9 commit fa1bf90
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion ocaml/sdk-gen/csharp/autogen/src/Session.cs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ public Session(JsonRpcClient client)
client.KeepAlive = true;
client.UserAgent = UserAgent;
client.WebProxy = Proxy;
client.JsonRpcVersion = JsonRpcVersion.v2;
client.AllowAutoRedirect = true;
JsonRpcClient = client;
}
Expand Down Expand Up @@ -145,6 +144,14 @@ private void SetAPIVersion()
Host host = Host.get_record(this, pool.master);
APIVersion = Helper.GetAPIVersion(host.API_version_major, host.API_version_minor);
}

if (JsonRpcClient != null)
{
if (APIVersion == API_Version.API_2_6)
JsonRpcClient.JsonRpcVersion = JsonRpcVersion.v1;
else if (APIVersion >= API_Version.API_2_8)
JsonRpcClient.JsonRpcVersion = JsonRpcVersion.v2;
}
}

private void CopyADFromSession(Session session)
Expand Down

0 comments on commit fa1bf90

Please sign in to comment.