Skip to content

Commit fa1bf90

Browse files
author
Konstantina Chremmou
committed
CP-53003: Use JsonRpc v1.0 by default and switch to v2.0 once the API version is known.
Signed-off-by: Konstantina Chremmou <[email protected]>
1 parent ad4f3d9 commit fa1bf90

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

ocaml/sdk-gen/csharp/autogen/src/Session.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ public Session(JsonRpcClient client)
6565
client.KeepAlive = true;
6666
client.UserAgent = UserAgent;
6767
client.WebProxy = Proxy;
68-
client.JsonRpcVersion = JsonRpcVersion.v2;
6968
client.AllowAutoRedirect = true;
7069
JsonRpcClient = client;
7170
}
@@ -145,6 +144,14 @@ private void SetAPIVersion()
145144
Host host = Host.get_record(this, pool.master);
146145
APIVersion = Helper.GetAPIVersion(host.API_version_major, host.API_version_minor);
147146
}
147+
148+
if (JsonRpcClient != null)
149+
{
150+
if (APIVersion == API_Version.API_2_6)
151+
JsonRpcClient.JsonRpcVersion = JsonRpcVersion.v1;
152+
else if (APIVersion >= API_Version.API_2_8)
153+
JsonRpcClient.JsonRpcVersion = JsonRpcVersion.v2;
154+
}
148155
}
149156

150157
private void CopyADFromSession(Session session)

0 commit comments

Comments
 (0)