Skip to content

Commit 9109573

Browse files
ivankamkinIvan Kamkin
andauthored
Release 25.4 (#122)
* Update version in settings Update csharp templates to System.Text.Json * Update templates * Switch all submodules to default * Update dart * Fix newlines in spec --------- Co-authored-by: Ivan Kamkin <[email protected]>
1 parent cbeede2 commit 9109573

24 files changed

+238
-131
lines changed

codegen/Templates/csharp/AbstractOpenAPISchema.mustache

Lines changed: 18 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{{>partial_header}}
22

33
using System;
4-
using Newtonsoft.Json;
5-
using Newtonsoft.Json.Serialization;
4+
using System.Text.Json;
5+
using System.Text.Json.Serialization;
66

77
namespace {{packageName}}.{{modelPackage}}
88
{
@@ -14,35 +14,28 @@ namespace {{packageName}}.{{modelPackage}}
1414
/// <summary>
1515
/// Custom JSON serializer
1616
/// </summary>
17-
public static readonly JsonSerializerSettings SerializerSettings = new JsonSerializerSettings
17+
public static readonly JsonSerializerOptions SerializerOptions = new JsonSerializerOptions
1818
{
19-
// OpenAPI generated types generally hide default constructors.
20-
ConstructorHandling = ConstructorHandling.AllowNonPublicDefaultConstructor,
21-
MissingMemberHandling = MissingMemberHandling.Error,
22-
ContractResolver = new DefaultContractResolver
23-
{
24-
NamingStrategy = new CamelCaseNamingStrategy
25-
{
26-
OverrideSpecifiedNames = false
27-
}
28-
}
19+
PropertyNamingPolicy = JsonNamingPolicy.CamelCase,
20+
PropertyNameCaseInsensitive = false,
21+
// To ignore comments or trailing commas, set these:
22+
ReadCommentHandling = JsonCommentHandling.Disallow,
23+
UnmappedMemberHandling = JsonUnmappedMemberHandling.Disallow,
24+
AllowTrailingCommas = false,
2925
};
3026

27+
3128
/// <summary>
32-
/// Custom JSON serializer for objects with additional properties
29+
/// Custom JSON serializer options for objects with additional properties.
3330
/// </summary>
34-
public static readonly JsonSerializerSettings AdditionalPropertiesSerializerSettings = new JsonSerializerSettings
31+
public static readonly JsonSerializerOptions AdditionalPropertiesSerializerOptions = new JsonSerializerOptions
3532
{
36-
// OpenAPI generated types generally hide default constructors.
37-
ConstructorHandling = ConstructorHandling.AllowNonPublicDefaultConstructor,
38-
MissingMemberHandling = MissingMemberHandling.Ignore,
39-
ContractResolver = new DefaultContractResolver
40-
{
41-
NamingStrategy = new CamelCaseNamingStrategy
42-
{
43-
OverrideSpecifiedNames = false
44-
}
45-
}
33+
PropertyNamingPolicy = JsonNamingPolicy.CamelCase,
34+
PropertyNameCaseInsensitive = false,
35+
36+
ReadCommentHandling = JsonCommentHandling.Disallow,
37+
AllowTrailingCommas = false,
38+
4639
};
4740

4841
/// <summary>

codegen/Templates/csharp/Configuration.mustache

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
using System;
22
using System.Collections.Generic;
3-
using Newtonsoft.Json;
4-
using Newtonsoft.Json.Converters;
3+
using System.Text.Json.Serialization;
54

65
namespace Aspose.BarCode.Cloud.Sdk.Api
76
{
@@ -71,7 +70,7 @@ namespace Aspose.BarCode.Cloud.Sdk.Api
7170
/// <summary>
7271
/// Authentication type.
7372
/// </summary>
74-
[JsonConverter(typeof(StringEnumConverter))]
73+
[JsonConverter(typeof(JsonStringEnumConverter))]
7574
public AuthType AuthType { get; private set; }
7675

7776
/// <summary>

codegen/Templates/csharp/README.mustache

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,8 @@ This repository contains Aspose.BarCode Cloud SDK for .NET source code. This SDK
2727

2828
Aspose.BarCode Cloud SDK for .NET provides cross-platform bindings for:
2929

30-
- .NET 5 and higher
30+
- .NET 8 and higher
3131
- .NET Standard 2.0 and higher
32-
- .NET Core 3.1 and higher
3332
- .NET Framework 4.6.2 and higher
3433

3534
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).
@@ -82,7 +81,7 @@ The examples below show how you can generate QR code and save it into local file
8281

8382
## Dependencies
8483

85-
- [Json.NET](https://www.nuget.org/packages/Newtonsoft.Json/)
84+
- [System.Text.Json](https://www.nuget.org/packages/System.Text.json)
8685

8786
## Licensing
8887

codegen/Templates/csharp/model.mustache

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@ using Aspose.BarCode.Cloud.Sdk.Interfaces;
88
using Aspose.BarCode.Cloud.Sdk.Internal;
99
{{/isEnum}}
1010
{{#isEnum}}
11-
using Newtonsoft.Json;
12-
using Newtonsoft.Json.Converters;
11+
using System.Text.Json.Serialization;
1312
{{/isEnum}}
1413

1514
namespace {{packageName}}.Model
@@ -19,7 +18,7 @@ namespace {{packageName}}.Model
1918
/// <summary>
2019
/// {{description}}
2120
/// </summary>
22-
[JsonConverter(typeof(StringEnumConverter))]
21+
[JsonConverter(typeof(JsonStringEnumConverter))]
2322
public enum {{classname}}{{#parent}} : {{{parent}}}{{/parent}}
2423
{ {{#allowableValues}}{{#values}}
2524
/// <summary>

codegen/Templates/csharp/netcore_project.mustache

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ Aspose.Barcode for Cloud allows you to control all aspects of the image and barc
4848

4949
<ItemGroup>
5050
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0" PrivateAssets="All" />
51-
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
51+
<PackageReference Include="System.Text.Json" Version="9.0.4" />
5252
</ItemGroup>
5353

5454
<ItemGroup>

codegen/Templates/csharp/netcore_testproject.mustache

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFramework>net6.0</TargetFramework>
5+
<TargetFramework>net8.0</TargetFramework>
66
<Nullable>enable</Nullable>
77
</PropertyGroup>
88

codegen/Templates/nodejs/package.mustache

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@
135135
"test": "npx jest",
136136
"cover": "npx jest --coverage",
137137
"lint": "npx eslint src test snippets",
138-
"format": "npx eslint src test snippets --fix",
138+
"format": "npx eslint src test snippets eslint.config.mjs --fix",
139139
"prepare": "npx tsup",
140140
"check-updates": "ncu -u --enginesNode"
141141
},

codegen/Templates/python/README.mustache

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ This repository contains Aspose.BarCode Cloud SDK for Python source code. This S
2626

2727
Supported Python versions:
2828

29-
- Python 3.6+
29+
- Python 3.7+
3030

3131
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).
3232

codegen/config-android.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"androidSdkVersion": "33",
55
"apiPackage": "com.aspose.barcode.cloud.demo_app",
66
"artifactId": "Android Application for Barcode Processing in the Cloud via REST API",
7-
"artifactVersion": "25.3.0",
7+
"artifactVersion": "25.4.0",
88
"groupId": "com.aspose",
99
"invokerPackage": "com.aspose.barcode.cloud.demo_app",
1010
"modelPackage": "com.aspose.barcode.cloud.demo_app.model"

codegen/config-dart.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33
"browserClient": false,
44
"pubDescription": "This SDK allows you to work with Aspose.BarCode for Cloud REST APIs in your Dart or Flutter applications quickly and easily",
55
"pubName": "aspose_barcode_cloud",
6-
"pubVersion": "4.25.3",
6+
"pubVersion": "4.25.4",
77
"useEnumExtension": true
88
}

0 commit comments

Comments
 (0)