sdk-generator
sdk-generator copied to clipboard
feat: migrate .NET templates to System.Text.Json + add .NET 9.0 tests
What does this PR do?
This pull request introduces two major improvements to the .NET SDK generator:
-
Refactors from Newtonsoft.Json to System.Text.Json for serialization/deserialization - A comprehensive migration that modernizes the .NET SDK by replacing the legacy
Newtonsoft.Jsonlibrary with Microsoft'sSystem.Text.Json library. This includes:- Updated package dependencies in
Package.csproj.twig - Migrated all serialization/deserialization logic in
Client.cs.twig,Query.cs.twig, andExtensions.cs.twig - Updated model attributes from
[JsonProperty]to[JsonPropertyName]inModel.cs.twig - Created new
ObjectToInferredTypesConverter.cs.twigfor proper object type handling - Replaced
JsonConverterwithJsonConverter<object>inValueClassConverter.cs.twig - Updated error handling to use
JsonDocumentinstead ofJObject
- Updated package dependencies in
-
Adds initial test support for .NET 9.0 SDK - Extends platform compatibility by adding test infrastructure for the latest .NET version:
- Created
DotNet90Test.phptest class for .NET 9.0 SDK validation - Added
Tests90.csprojproject file targeting .NET 9.0 framework
- Created
Test Plan
Regenerate .NET SDKs using the updated templates and verify that existing client code continues to work without changes
Related PRs and Issues
(https://github.com/appwrite/sdk-for-dotnet/issues/48)
Have you read the Contributing Guidelines on issues?
Yes