diff --git a/.github/workflows/dotnet-core.yml b/.github/workflows/dotnet-core.yml
index ab09001..d185a74 100644
--- a/.github/workflows/dotnet-core.yml
+++ b/.github/workflows/dotnet-core.yml
@@ -1,4 +1,4 @@
-name: .NET Core Linux
+name: .NET Linux
on:
push:
@@ -16,14 +16,10 @@ jobs:
# and https://github.com/dotnet/core/blob/main/releases.md
# for versions
include:
- - dotnet-version: 3.1.x
- framework: netcoreapp3.1
- - dotnet-version: 5.0.x
- framework: net5.0
- - dotnet-version: 6.0.x
- framework: net6.0
- dotnet-version: 8.0.x
framework: net8.0
+ - dotnet-version: 9.0.x
+ framework: net9.0
continue-on-error: true
diff --git a/.github/workflows/test-examples-and-snippets.yml b/.github/workflows/test-examples-and-snippets.yml
index a4d24dd..4d09d19 100644
--- a/.github/workflows/test-examples-and-snippets.yml
+++ b/.github/workflows/test-examples-and-snippets.yml
@@ -8,7 +8,8 @@ on:
jobs:
build-examples:
- runs-on: ubuntu-22.04
+ runs-on: ubuntu-latest
+
steps:
- uses: actions/checkout@v4
diff --git a/README.md b/README.md
index d7c0525..75d3cd8 100644
--- a/README.md
+++ b/README.md
@@ -6,7 +6,7 @@
[](https://www.nuget.org/packages/Aspose.BarCode-Cloud/)
- API version: 4.0
-- SDK version: 25.3.0
+- SDK version: 25.4.0
## SDK and API Version Compatibility:
@@ -27,9 +27,8 @@ This repository contains Aspose.BarCode Cloud SDK for .NET source code. This SDK
Aspose.BarCode Cloud SDK for .NET provides cross-platform bindings for:
-- .NET 5 and higher
+- .NET 8 and higher
- .NET Standard 2.0 and higher
-- .NET Core 3.1 and higher
- .NET Framework 4.6.2 and higher
To use these SDKs, you will need Client Id and Client Secret which can be looked up at [Aspose Cloud Dashboard](https://dashboard.aspose.cloud/applications) (free registration in Aspose Cloud is required for this).
@@ -201,7 +200,7 @@ internal static class Program
## Dependencies
-- [Json.NET](https://www.nuget.org/packages/Newtonsoft.Json/)
+- [System.Text.Json](https://www.nuget.org/packages/System.Text.json)
## Licensing
diff --git a/Tests/Aspose.BarCode.Cloud.Sdk.Tests.csproj b/Tests/Aspose.BarCode.Cloud.Sdk.Tests.csproj
index 41f9c0e..74b5277 100644
--- a/Tests/Aspose.BarCode.Cloud.Sdk.Tests.csproj
+++ b/Tests/Aspose.BarCode.Cloud.Sdk.Tests.csproj
@@ -1,7 +1,7 @@
- net462;net480;net481;netcoreapp3.1;net5.0;net6.0;net8.0
+ net462;net480;net481;net8.0;net9.0
true
true
8.0
diff --git a/Tests/ConfigurationTests.cs b/Tests/ConfigurationTests.cs
index 3acfb52..3360344 100644
--- a/Tests/ConfigurationTests.cs
+++ b/Tests/ConfigurationTests.cs
@@ -1,7 +1,7 @@
using System.Collections.Generic;
using System.IO;
using Aspose.BarCode.Cloud.Sdk.Api;
-using Newtonsoft.Json;
+using System.Text.Json;
using NUnit.Framework;
namespace Aspose.BarCode.Cloud.Sdk.Tests
@@ -90,13 +90,11 @@ public void DefaultParamsTest()
[Test]
public void DeserializeTest()
{
- using StreamReader file = File.OpenText(Path.Combine(
+ using FileStream file = File.OpenRead(Path.Combine(
TestContext.CurrentContext.TestDirectory,
"..", "..", "..",
"Configuration.template.json"));
- JsonSerializer serializer = new JsonSerializer();
- using JsonTextReader reader = new JsonTextReader(file);
- Configuration config = serializer.Deserialize(reader);
+ var config = JsonSerializer.Deserialize(file);
Assert.IsNotNull(config);
Assert.AreEqual("Client Secret from https://dashboard.aspose.cloud/applications", config.ClientSecret);
@@ -131,7 +129,7 @@ public void SerializationTest()
"ApiVersion\":\"4.0\",\"" +
"DefaultHeaders\":{}" +
"}",
- JsonConvert.SerializeObject(config));
+ JsonSerializer.Serialize(config));
}
}
}
diff --git a/Tests/JWTRequestHandlerTests.cs b/Tests/JWTRequestHandlerTests.cs
index 841ed27..f6bf975 100644
--- a/Tests/JWTRequestHandlerTests.cs
+++ b/Tests/JWTRequestHandlerTests.cs
@@ -4,12 +4,12 @@
using System.Net;
using System.Net.Http;
using System.Text;
+using System.Text.Json;
using System.Threading.Tasks;
using Aspose.BarCode.Cloud.Sdk.Api;
using Aspose.BarCode.Cloud.Sdk.Internal;
using Aspose.BarCode.Cloud.Sdk.Internal.RequestHandlers;
using Moq;
-using Newtonsoft.Json.Linq;
using NUnit.Framework;
namespace Aspose.BarCode.Cloud.Sdk.Tests
@@ -169,9 +169,9 @@ private static void AssertTokenIsValid(string token)
{
string firstPartBeforeDot = new string(token.TakeWhile(c => c != '.').ToArray());
byte[] tokenBytes = Convert.FromBase64String(firstPartBeforeDot);
- JObject tokenHeader = JObject.Parse(Encoding.UTF8.GetString(tokenBytes));
+ JsonElement tokenHeader = JsonDocument.Parse(Encoding.UTF8.GetString(tokenBytes)).RootElement;
- Assert.AreEqual("JWT", tokenHeader["typ"]?.ToString());
+ Assert.AreEqual("JWT", tokenHeader.GetProperty("typ").GetString());
}
}
}
diff --git a/Tests/JwtAuthTests.cs b/Tests/JwtAuthTests.cs
index 37863cc..27ac391 100644
--- a/Tests/JwtAuthTests.cs
+++ b/Tests/JwtAuthTests.cs
@@ -2,11 +2,10 @@
using System.Collections.Generic;
using System.IO;
using System.Net.Http;
+using System.Text.Json;
using System.Threading.Tasks;
using Aspose.BarCode.Cloud.Sdk.Api;
using Aspose.BarCode.Cloud.Sdk.Model;
-
-using Newtonsoft.Json.Linq;
using NUnit.Framework;
namespace Aspose.BarCode.Cloud.Sdk.Tests
@@ -27,8 +26,8 @@ private async Task FetchToken()
FormUrlEncodedContent formContent = new FormUrlEncodedContent(formParams);
HttpResponseMessage response = await new HttpClient().PostAsync(TestConfiguration.TokenUrl, formContent);
response.EnsureSuccessStatusCode();
- JObject json = JObject.Parse(await response.Content.ReadAsStringAsync());
- string accessToken = Convert.ToString(json["access_token"]);
+ JsonDocument json = JsonDocument.Parse(await response.Content.ReadAsStringAsync());
+ string accessToken = json.RootElement.GetProperty("access_token").GetString();
return accessToken;
}
diff --git a/Tests/RecognizeTests.cs b/Tests/RecognizeTests.cs
index 0a1918f..fd5c206 100644
--- a/Tests/RecognizeTests.cs
+++ b/Tests/RecognizeTests.cs
@@ -32,7 +32,7 @@ public async Task RecognizeBase64AsyncTest()
using Stream image = GetTestImage("Test_PostGenerateMultiple.png");
byte[] buffer = new byte[image.Length];
- await image.ReadAsync(buffer, 0, buffer.Length);
+ _ = await image.ReadAsync(buffer, 0, buffer.Length);
// Act
BarcodeResponseList response = await _api.RecognizeBase64Async(
diff --git a/Tests/ScanTests.cs b/Tests/ScanTests.cs
index 418a30c..d8555bf 100644
--- a/Tests/ScanTests.cs
+++ b/Tests/ScanTests.cs
@@ -29,7 +29,7 @@ public async Task ScanBase64AsyncTest()
byte[] buffer = new byte[image.Length];
- await image.ReadAsync(buffer, 0, buffer.Length);
+ _ = await image.ReadAsync(buffer, 0, buffer.Length);
// Act
BarcodeResponseList response = await _api.ScanBase64Async(
new ScanBase64Request()
diff --git a/Tests/TestsBase.cs b/Tests/TestsBase.cs
index e495f60..f5cad09 100644
--- a/Tests/TestsBase.cs
+++ b/Tests/TestsBase.cs
@@ -3,8 +3,7 @@
using System.IO;
using System.Text;
using Aspose.BarCode.Cloud.Sdk.Api;
-using Newtonsoft.Json;
-using Newtonsoft.Json.Linq;
+using System.Text.Json;
using NUnit.Framework;
namespace Aspose.BarCode.Cloud.Sdk.Tests
@@ -36,38 +35,44 @@ private static Configuration LoadTestConfiguration()
"Configuration.json"));
if (File.Exists(configFilename))
{
- using StreamReader file = File.OpenText(configFilename);
- using JsonTextReader reader = new JsonTextReader(file);
- JsonSerializer serializer = new JsonSerializer();
- return serializer.Deserialize(reader);
+ using FileStream file = File.OpenRead(configFilename);
+ return JsonSerializer.Deserialize(file)
+ ?? throw new Exception("Configuration file is empty or invalid");
}
-
Configuration config = LoadFromEnv();
-
return config;
}
private static Configuration LoadFromEnv()
{
- string jsonStr = JsonConvert.SerializeObject(new Configuration());
- JObject obj = JObject.Parse(jsonStr);
- foreach (KeyValuePair i in obj)
+ // Serialize default config to JSON then to a dictionary
+ string jsonStr = JsonSerializer.Serialize(new Configuration());
+ var dict = JsonSerializer.Deserialize>(jsonStr);
+
+ if (dict == null)
+ throw new Exception("Default configuration invalid");
+
+ foreach (var key in new List(dict.Keys))
{
- if (!(i.Value.Type == JTokenType.String || i.Value.Type == JTokenType.Null))
- {
+ var value = dict[key];
+
+ // Accept strings and nulls (JSON null becomes null here)
+ if (value != null && !(value is string))
continue;
- }
- string name = i.Key;
- string envName = $"{ENV_NAME_PREFIX}{CamelCaseToUpper(name)}";
+ string envName = $"{ENV_NAME_PREFIX}{CamelCaseToUpper(key)}";
string envValue = Environment.GetEnvironmentVariable(envName);
if (!string.IsNullOrEmpty(envValue))
{
- obj[name] = envValue;
+ dict[key] = envValue;
}
}
-
- return JsonConvert.DeserializeObject(obj.ToString());
+ // Serialize back and then deserialize to Configuration
+ string updatedJson = JsonSerializer.Serialize(dict);
+ var config = JsonSerializer.Deserialize(updatedJson);
+ if (config == null)
+ throw new Exception("Failed to create Configuration from environment variables");
+ return config;
}
private static string CamelCaseToUpper(string name)
diff --git a/examples/GenerateQR/GenerateQR.csproj b/examples/GenerateQR/GenerateQR.csproj
index c72b0c8..4ce8d3f 100644
--- a/examples/GenerateQR/GenerateQR.csproj
+++ b/examples/GenerateQR/GenerateQR.csproj
@@ -2,12 +2,12 @@
Exe
- net6.0
+ net8.0
enable
-
+
diff --git a/examples/ReadQR/ReadQR.csproj b/examples/ReadQR/ReadQR.csproj
index c72b0c8..4ce8d3f 100644
--- a/examples/ReadQR/ReadQR.csproj
+++ b/examples/ReadQR/ReadQR.csproj
@@ -2,12 +2,12 @@
Exe
- net6.0
+ net8.0
enable
-
+
diff --git a/snippets/Snippets.csproj b/snippets/Snippets.csproj
index c72b0c8..4ce8d3f 100644
--- a/snippets/Snippets.csproj
+++ b/snippets/Snippets.csproj
@@ -2,12 +2,12 @@
Exe
- net6.0
+ net8.0
enable
-
+
diff --git a/snippets/dependency.xml b/snippets/dependency.xml
index 1552ae5..df4026c 100644
--- a/snippets/dependency.xml
+++ b/snippets/dependency.xml
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/src/Api/Configuration.cs b/src/Api/Configuration.cs
index 06a82bb..2e677b8 100644
--- a/src/Api/Configuration.cs
+++ b/src/Api/Configuration.cs
@@ -1,7 +1,6 @@
using System;
using System.Collections.Generic;
-using Newtonsoft.Json;
-using Newtonsoft.Json.Converters;
+using System.Text.Json.Serialization;
namespace Aspose.BarCode.Cloud.Sdk.Api
{
@@ -71,7 +70,7 @@ public string JwtToken
///
/// Authentication type.
///
- [JsonConverter(typeof(StringEnumConverter))]
+ [JsonConverter(typeof(JsonStringEnumConverter))]
public AuthType AuthType { get; private set; }
///
diff --git a/src/Aspose.BarCode.Cloud.Sdk.csproj b/src/Aspose.BarCode.Cloud.Sdk.csproj
index 952e3e6..258ac75 100644
--- a/src/Aspose.BarCode.Cloud.Sdk.csproj
+++ b/src/Aspose.BarCode.Cloud.Sdk.csproj
@@ -24,11 +24,11 @@ Aspose.Barcode for Cloud allows you to control all aspects of the image and barc
Aspose.BarCode-Cloud
Aspose.BarCode Cloud SDK for .NET
PackageIcon.png
- 25.3.0
+ 25.4.0
Aspose
- 25.3.0.0
+ 25.4.0.0
README.md
- https://github.com/aspose-barcode-cloud/aspose-barcode-cloud-dotnet/releases/tag/v25.3.0
+ https://github.com/aspose-barcode-cloud/aspose-barcode-cloud-dotnet/releases/tag/v25.4.0
true
LICENSE.txt
true
@@ -48,7 +48,7 @@ Aspose.Barcode for Cloud allows you to control all aspects of the image and barc
-
+
diff --git a/src/Internal/RequestHandlers/JWTRequestHandler.cs b/src/Internal/RequestHandlers/JWTRequestHandler.cs
index c9f4e6f..5064d60 100644
--- a/src/Internal/RequestHandlers/JWTRequestHandler.cs
+++ b/src/Internal/RequestHandlers/JWTRequestHandler.cs
@@ -5,7 +5,8 @@
using System.Threading.Tasks;
using Aspose.BarCode.Cloud.Sdk.Api;
using Aspose.BarCode.Cloud.Sdk.Interfaces;
-using Newtonsoft.Json;
+using System.Text.Json;
+using System.Text.Json.Serialization;
namespace Aspose.BarCode.Cloud.Sdk.Internal.RequestHandlers
{
@@ -198,13 +199,13 @@ public async Task ProcessResponseAsync(HttpResponseMessage response)
private class GetAccessTokenResult
{
- [JsonProperty(PropertyName = "access_token")]
+ [JsonPropertyName("access_token")]
public string AccessToken { get; set; }
- [JsonProperty(PropertyName = "expires_in")]
+ [JsonPropertyName("expires_in")]
public long ExpiresIn { get; set; }
- [JsonProperty(PropertyName = "token_type")]
+ [JsonPropertyName("token_type")]
public string TokenType { get; set; }
}
}
diff --git a/src/Internal/SerializationHelper.cs b/src/Internal/SerializationHelper.cs
index 4b3fca7..623b0d5 100644
--- a/src/Internal/SerializationHelper.cs
+++ b/src/Internal/SerializationHelper.cs
@@ -3,23 +3,26 @@
using System.Xml;
using Aspose.BarCode.Cloud.Sdk.Api;
using Aspose.BarCode.Cloud.Sdk.Interfaces;
-using Newtonsoft.Json;
+using System.Text.Json;
+using System.Text.Json.Serialization;
namespace Aspose.BarCode.Cloud.Sdk.Internal
{
internal static class SerializationHelper
{
+ private static readonly JsonSerializerOptions JsonOptions = new JsonSerializerOptions
+ {
+ DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull,
+ PropertyNameCaseInsensitive = true,
+ };
public static string Serialize(object obj)
{
try
{
return obj != null
- ? JsonConvert.SerializeObject(
- obj,
- new JsonSerializerSettings
- {
- NullValueHandling = NullValueHandling.Ignore
- })
+ ? JsonSerializer.Serialize(
+ obj, JsonOptions
+ )
: null;
}
catch (Exception e)
@@ -34,7 +37,7 @@ public static object Deserialize(string json, Type type)
{
if (json.StartsWith("{", StringComparison.InvariantCulture) || json.StartsWith("[", StringComparison.InvariantCulture))
{
- object jObj = JsonConvert.DeserializeObject(json, type);
+ object jObj = JsonSerializer.Deserialize(json, type, JsonOptions);
if (jObj is IToString jToString)
{
jToString.SetSrcString(json);
@@ -48,7 +51,7 @@ public static object Deserialize(string json, Type type)
{
throw new ApiException(500, e.Message);
}
- catch (JsonSerializationException jsE)
+ catch (JsonException jsE)
{
throw new ApiException(500, jsE.Message);
}
diff --git a/src/Model/AbstractOpenAPISchema.cs b/src/Model/AbstractOpenAPISchema.cs
index 48564c7..cd9be05 100644
--- a/src/Model/AbstractOpenAPISchema.cs
+++ b/src/Model/AbstractOpenAPISchema.cs
@@ -25,8 +25,8 @@
using System;
-using Newtonsoft.Json;
-using Newtonsoft.Json.Serialization;
+using System.Text.Json;
+using System.Text.Json.Serialization;
namespace Aspose.BarCode.Cloud.Sdk.Model
{
@@ -38,35 +38,28 @@ public abstract partial class AbstractOpenAPISchema
///
/// Custom JSON serializer
///
- public static readonly JsonSerializerSettings SerializerSettings = new JsonSerializerSettings
+ public static readonly JsonSerializerOptions SerializerOptions = new JsonSerializerOptions
{
- // OpenAPI generated types generally hide default constructors.
- ConstructorHandling = ConstructorHandling.AllowNonPublicDefaultConstructor,
- MissingMemberHandling = MissingMemberHandling.Error,
- ContractResolver = new DefaultContractResolver
- {
- NamingStrategy = new CamelCaseNamingStrategy
- {
- OverrideSpecifiedNames = false
- }
- }
+ PropertyNamingPolicy = JsonNamingPolicy.CamelCase,
+ PropertyNameCaseInsensitive = false,
+ // To ignore comments or trailing commas, set these:
+ ReadCommentHandling = JsonCommentHandling.Disallow,
+ UnmappedMemberHandling = JsonUnmappedMemberHandling.Disallow,
+ AllowTrailingCommas = false,
};
+
///
- /// Custom JSON serializer for objects with additional properties
+ /// Custom JSON serializer options for objects with additional properties.
///
- public static readonly JsonSerializerSettings AdditionalPropertiesSerializerSettings = new JsonSerializerSettings
+ public static readonly JsonSerializerOptions AdditionalPropertiesSerializerOptions = new JsonSerializerOptions
{
- // OpenAPI generated types generally hide default constructors.
- ConstructorHandling = ConstructorHandling.AllowNonPublicDefaultConstructor,
- MissingMemberHandling = MissingMemberHandling.Ignore,
- ContractResolver = new DefaultContractResolver
- {
- NamingStrategy = new CamelCaseNamingStrategy
- {
- OverrideSpecifiedNames = false
- }
- }
+ PropertyNamingPolicy = JsonNamingPolicy.CamelCase,
+ PropertyNameCaseInsensitive = false,
+
+ ReadCommentHandling = JsonCommentHandling.Disallow,
+ AllowTrailingCommas = false,
+
};
///
diff --git a/src/Model/BarcodeImageFormat.cs b/src/Model/BarcodeImageFormat.cs
index 4b2916e..e3f6838 100644
--- a/src/Model/BarcodeImageFormat.cs
+++ b/src/Model/BarcodeImageFormat.cs
@@ -1,6 +1,5 @@
-using Newtonsoft.Json;
-using Newtonsoft.Json.Converters;
+using System.Text.Json.Serialization;
namespace Aspose.BarCode.Cloud.Sdk.Model
{
@@ -8,7 +7,7 @@ namespace Aspose.BarCode.Cloud.Sdk.Model
///
/// Specifies the file format of the image.
///
- [JsonConverter(typeof(StringEnumConverter))]
+ [JsonConverter(typeof(JsonStringEnumConverter))]
public enum BarcodeImageFormat
{
///
diff --git a/src/Model/CodeLocation.cs b/src/Model/CodeLocation.cs
index 7250f0b..1148996 100644
--- a/src/Model/CodeLocation.cs
+++ b/src/Model/CodeLocation.cs
@@ -1,6 +1,5 @@
-using Newtonsoft.Json;
-using Newtonsoft.Json.Converters;
+using System.Text.Json.Serialization;
namespace Aspose.BarCode.Cloud.Sdk.Model
{
@@ -8,7 +7,7 @@ namespace Aspose.BarCode.Cloud.Sdk.Model
///
///
///
- [JsonConverter(typeof(StringEnumConverter))]
+ [JsonConverter(typeof(JsonStringEnumConverter))]
public enum CodeLocation
{
///
diff --git a/src/Model/DecodeBarcodeType.cs b/src/Model/DecodeBarcodeType.cs
index 8291f63..198ab69 100644
--- a/src/Model/DecodeBarcodeType.cs
+++ b/src/Model/DecodeBarcodeType.cs
@@ -1,6 +1,5 @@
-using Newtonsoft.Json;
-using Newtonsoft.Json.Converters;
+using System.Text.Json.Serialization;
namespace Aspose.BarCode.Cloud.Sdk.Model
{
@@ -8,7 +7,7 @@ namespace Aspose.BarCode.Cloud.Sdk.Model
///
/// See Aspose.BarCode.Aspose.BarCode.BarCodeRecognition.DecodeType
///
- [JsonConverter(typeof(StringEnumConverter))]
+ [JsonConverter(typeof(JsonStringEnumConverter))]
public enum DecodeBarcodeType
{
///
diff --git a/src/Model/EncodeBarcodeType.cs b/src/Model/EncodeBarcodeType.cs
index 138a097..24dba3e 100644
--- a/src/Model/EncodeBarcodeType.cs
+++ b/src/Model/EncodeBarcodeType.cs
@@ -1,6 +1,5 @@
-using Newtonsoft.Json;
-using Newtonsoft.Json.Converters;
+using System.Text.Json.Serialization;
namespace Aspose.BarCode.Cloud.Sdk.Model
{
@@ -8,7 +7,7 @@ namespace Aspose.BarCode.Cloud.Sdk.Model
///
/// See Aspose.BarCode.Generation.EncodeTypes
///
- [JsonConverter(typeof(StringEnumConverter))]
+ [JsonConverter(typeof(JsonStringEnumConverter))]
public enum EncodeBarcodeType
{
///
diff --git a/src/Model/EncodeDataType.cs b/src/Model/EncodeDataType.cs
index 1045a4b..74c6ef9 100644
--- a/src/Model/EncodeDataType.cs
+++ b/src/Model/EncodeDataType.cs
@@ -1,6 +1,5 @@
-using Newtonsoft.Json;
-using Newtonsoft.Json.Converters;
+using System.Text.Json.Serialization;
namespace Aspose.BarCode.Cloud.Sdk.Model
{
@@ -8,7 +7,7 @@ namespace Aspose.BarCode.Cloud.Sdk.Model
///
/// Types of data can be encoded to barcode
///
- [JsonConverter(typeof(StringEnumConverter))]
+ [JsonConverter(typeof(JsonStringEnumConverter))]
public enum EncodeDataType
{
///
diff --git a/src/Model/GraphicsUnit.cs b/src/Model/GraphicsUnit.cs
index 0debdc4..41e0581 100644
--- a/src/Model/GraphicsUnit.cs
+++ b/src/Model/GraphicsUnit.cs
@@ -1,6 +1,5 @@
-using Newtonsoft.Json;
-using Newtonsoft.Json.Converters;
+using System.Text.Json.Serialization;
namespace Aspose.BarCode.Cloud.Sdk.Model
{
@@ -8,7 +7,7 @@ namespace Aspose.BarCode.Cloud.Sdk.Model
///
/// Subset of Aspose.Drawing.GraphicsUnit.
///
- [JsonConverter(typeof(StringEnumConverter))]
+ [JsonConverter(typeof(JsonStringEnumConverter))]
public enum GraphicsUnit
{
///
diff --git a/src/Model/RecognitionImageKind.cs b/src/Model/RecognitionImageKind.cs
index 275b31e..bbc712b 100644
--- a/src/Model/RecognitionImageKind.cs
+++ b/src/Model/RecognitionImageKind.cs
@@ -1,6 +1,5 @@
-using Newtonsoft.Json;
-using Newtonsoft.Json.Converters;
+using System.Text.Json.Serialization;
namespace Aspose.BarCode.Cloud.Sdk.Model
{
@@ -8,7 +7,7 @@ namespace Aspose.BarCode.Cloud.Sdk.Model
///
/// Kind of image to recognize
///
- [JsonConverter(typeof(StringEnumConverter))]
+ [JsonConverter(typeof(JsonStringEnumConverter))]
public enum RecognitionImageKind
{
///
diff --git a/src/Model/RecognitionMode.cs b/src/Model/RecognitionMode.cs
index 27def47..be37d92 100644
--- a/src/Model/RecognitionMode.cs
+++ b/src/Model/RecognitionMode.cs
@@ -1,6 +1,5 @@
-using Newtonsoft.Json;
-using Newtonsoft.Json.Converters;
+using System.Text.Json.Serialization;
namespace Aspose.BarCode.Cloud.Sdk.Model
{
@@ -8,7 +7,7 @@ namespace Aspose.BarCode.Cloud.Sdk.Model
///
/// Recognition mode.
///
- [JsonConverter(typeof(StringEnumConverter))]
+ [JsonConverter(typeof(JsonStringEnumConverter))]
public enum RecognitionMode
{
///