Closed benspeth closed 2 years ago
Hi @benspeth, we'll take a look and see what our options are.
I'm having the same issue. The SDK was working fine until I started using NSwag and then Optimizely broke.
Change from
var client = new Optimizely(dataFile);
To
var client = new Optimizely(dataFile, skipJsonValidation: true);
Looks like, starting with version 10.x, NJsonSchema introduced a breaking change.
Screenshot showing class name loses the number 4 starting with version 10.x |
Maybe the nuspec should look like this, note the ranges in the NJsonSchema dependencies
<?xml version="1.0" encoding="utf-8"?>
<package>
<metadata>
<id>Optimizely.SDK</id>
<version>3.2.0</version>
<title>Optimizely C# SDK</title>
<authors>Optimizely Development Team</authors>
<owners>fullstack.optimizely</owners>
<license type="expression">Apache-2.0</license>
<projectUrl>https://github.com/optimizely/csharp-sdk</projectUrl>
<icon>OptimizelySDK.png</icon>
<iconUrl>https://github.com/optimizely/csharp-sdk/blob/master/OptimizelySDK.png?raw=true</iconUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>C# SDK for Optimizely X Fullstack</description>
<releaseNotes>https://github.com/optimizely/csharp-sdk/blob/master/CHANGELOG.md</releaseNotes>
<copyright>Copyright 2017-2019</copyright>
<tags>Optimizely</tags>
<dependencies>
<group targetFramework=".NETFramework4.5">
<dependency id="murmurhash-signed" version="1.0.2" />
<dependency id="Newtonsoft.Json" version="9.0.1" />
<dependency id="NJsonSchema" version="[8.30.6304.31883,10)" />
</group>
<group targetFramework=".NETFramework3.5">
<dependency id="murmurhash-signed" version="1.0.2" />
<dependency id="Newtonsoft.Json" version="9.0.1" />
</group>
<group targetFramework=".NETFramework4.0">
<dependency id="murmurhash-signed" version="1.0.2" />
<dependency id="Newtonsoft.Json" version="9.0.1" />
</group>
<group targetFramework=".NETStandard1.6">
<dependency id="NETStandard.Library" version="1.6.1" />
<dependency id="murmurhash-signed" version="1.0.2" />
<dependency id="Newtonsoft.Json" version="9.0.1" />
<dependency id="NJsonSchema" version="[8.33.6323.36213,10)" />
</group>
<group targetFramework="netstandard2.0">
<dependency id="NETStandard.Library" version="2.0.3" />
<dependency id="murmurhash-signed" version="1.0.2" />
<dependency id="Newtonsoft.Json" version="9.0.1" />
<dependency id="NJsonSchema" version="[8.33.6323.36213,10)" />
<dependency id="System.Configuration.ConfigurationManager" version="4.5.0" />
</group>
</dependencies>
</metadata>
<files>
<file src="./../OptimizelySDK.png" target="OptimizelySDK.png" />
<file src="lib\**" target="lib" />
</files>
</package>
We're going to investigate our options for the nuspec definition. Thanks for the additional information.
@[benspeth] For now, the workaround is to by-pass datafile json validation. In our next major release we will upgrade NJsonScheme to the newer one and nuspec file. Please close this issue if you agree or we can help you to build the nuget / DLL at your end and you can make the change yourself.
Closing this ticket. Feel free to contact if you need more details.
Hi,
I am using NJsonSchema v10.4.6 on my app (due to some new dependency added) and optimizely started throwing the following exception.
Is it possible to make optimizely sdk compatible with newer version of NJsonSchema ?