Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
# Changelog

## [v1.0.0-beta.1](https://github.com/contentstack/contentstack-management-dotnet/tree/v0.11.0-beta.1)
## [v1.0.0-beta.2](https://github.com/contentstack/contentstack-management-dotnet/tree/v1.0.0-beta.2)
- **System.Text.Json Migration Complete (Beta)**
- **✅ Core Modules STJ-Only**: Client, User, Organization, and Stack modules fully migrated
- **✅ Service Layer**: All User, Organization, Stack services converted to System.Text.Json
- **✅ Model Updates**: Updated constructors and service calls to use JsonSerializerOptions
- **✅ Response Handling**: Implemented OpenJsonObjectResponse() for STJ-based JSON parsing
- **✅ Backward Compatibility**: Non-migrated modules continue using Newtonsoft.Json
- **✅ Testing Infrastructure**: Comprehensive web application for STJ validation
- **Performance**: Improved JSON serialization performance and reduced memory footprint
- **Architecture**: Clean separation between STJ and Newtonsoft implementations

## [v1.0.0-beta.1](https://github.com/contentstack/contentstack-management-dotnet/tree/v1.0.0-beta.1)
- **Breaking Change**
- **System.Text.Json Migration (Beta)**
- Migrated core serialization from Newtonsoft.Json to System.Text.Json
Expand Down
36 changes: 15 additions & 21 deletions Contentstack.Management.Core/ContentstackClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -131,17 +131,17 @@ public ContentstackClient(ContentstackClientOptions contentstackOptions) :
/// </code></pre>
/// </example>
public ContentstackClient(
string authtoken = null,
string? authtoken = null,
string host = "api.contentstack.io",
int port = 443,
string version = "v3",
bool disableLogging = false,
long maxResponseContentBufferSize = CSConstants.ContentBufferSize,
int timeout = 30,
bool retryOnError = true,
string proxyHost = null,
string? proxyHost = null,
int proxyPort = -1,
ICredentials proxyCredentials = null
ICredentials? proxyCredentials = null
) :
this(new OptionsWrapper<ContentstackClientOptions>(new ContentstackClientOptions()
{
Expand All @@ -161,7 +161,7 @@ public ContentstackClient(
{ }
#endregion

protected void Initialize(HttpClient httpClient = null)
protected void Initialize(HttpClient? httpClient = null)
{
if (httpClient != null)
{
Expand Down Expand Up @@ -229,7 +229,7 @@ protected void BuildPipeline()
}, LogManager);
}

internal ContentstackResponse InvokeSync<TRequest>(TRequest request, bool addAcceptMediaHeader = false, string apiVersion = null) where TRequest : IContentstackService
internal ContentstackResponse InvokeSync<TRequest>(TRequest request, bool addAcceptMediaHeader = false, string? apiVersion = null) where TRequest : IContentstackService
{
ThrowIfDisposed();

Expand All @@ -246,7 +246,7 @@ internal ContentstackResponse InvokeSync<TRequest>(TRequest request, bool addAcc
return (ContentstackResponse)ContentstackPipeline.InvokeSync(context, addAcceptMediaHeader, apiVersion).httpResponse;
}

internal async Task<TResponse> InvokeAsync<TRequest, TResponse>(TRequest request, bool addAcceptMediaHeader = false, string apiVersion = null)
internal async Task<TResponse> InvokeAsync<TRequest, TResponse>(TRequest request, bool addAcceptMediaHeader = false, string? apiVersion = null)
where TRequest : IContentstackService
where TResponse : ContentstackResponse
{
Expand Down Expand Up @@ -307,7 +307,6 @@ private void ThrowIfDisposed()
}
#endregion

/*
/// <summary>
/// <see cref="Models.User" /> session consists of calls that will help you to update user of your Contentstack account.
/// </summary>
Expand All @@ -322,9 +321,7 @@ public User User()
{
return new User(this);
}
*/

/*
/// <summary>
/// <see cref="Models.Organization" /> the top-level entity in the hierarchy of Contentstack, consisting of stacks and stack resources, and users.
/// <see cref="Models.Organization" /> allows easy management of projects as well as users within the Organization.
Expand All @@ -337,13 +334,11 @@ public User User()
/// </code></pre>
/// </example>
/// <returns>The <see cref="Models.Organization" />.</returns>
public Organization Organization(string uid = null)
public Organization Organization(string? uid = null)
{
return new Organization(this, uid);
}
*/

/*
/// <summary>
/// <see cref="Models.Stack" /> is a space that stores the content of a project (a web or mobile property).
/// Within a stack, you can create content structures, content entries, users, etc. related to the project.
Expand All @@ -352,16 +347,15 @@ public Organization Organization(string uid = null)
/// <param name="managementToken">Stack Management token </param>
/// <example>
/// <pre><code>
/// ContentstackClient client = new ContentstackClient("<AUTHTOKEN>", "<API_HOST>");
/// ContentstackClient client = new ContentstackClient("<AUTHTOKEN>", "<API_KEY>");
/// Stack Stack = client.Stack("<API_KEY>");
/// </code></pre>
/// </example>
/// <returns>The <see cref="Models.Stack" />.</returns>
public Stack Stack(string apiKey = null, string managementToken = null, string branchUid = null)
public Stack Stack(string? apiKey = null, string? managementToken = null, string? branchUid = null)
{
return new Stack(this, apiKey, managementToken, branchUid);
}
*/

#region LoginMethod
/// <summary>
Expand All @@ -378,7 +372,7 @@ public Stack Stack(string apiKey = null, string managementToken = null, string b
/// </code></pre>
/// </example>
/// <returns>The <see cref="ContentstackResponse" /></returns>
public ContentstackResponse Login(ICredentials credentials, string token = null, string mfaSecret = null)
public ContentstackResponse Login(ICredentials credentials, string? token = null, string? mfaSecret = null)
{
ThrowIfAlreadyLoggedIn();
LoginService Login = new LoginService(SerializerOptions, credentials, token, mfaSecret);
Expand All @@ -400,7 +394,7 @@ public ContentstackResponse Login(ICredentials credentials, string token = null,
/// </code></pre>
/// </example>
/// <returns>The Task.</returns>
public Task<ContentstackResponse> LoginAsync(ICredentials credentials, string token = null, string mfaSecret = null)
public Task<ContentstackResponse> LoginAsync(ICredentials credentials, string? token = null, string? mfaSecret = null)
{
ThrowIfAlreadyLoggedIn();
LoginService Login = new LoginService(SerializerOptions, credentials, token, mfaSecret);
Expand Down Expand Up @@ -440,7 +434,7 @@ internal void ThrowIfNotLoggedIn()
/// </code></pre>
/// </example>
/// <returns>The <see cref="ContentstackResponse" /></returns>
public ContentstackResponse Logout(string authtoken = null)
public ContentstackResponse Logout(string? authtoken = null)
{
string token = authtoken ?? contentstackOptions.Authtoken;
LogoutService logout = new LogoutService(SerializerOptions, token);
Expand All @@ -458,7 +452,7 @@ public ContentstackResponse Logout(string authtoken = null)
/// </code></pre>
/// </example>
/// <returns>The Task.</returns>
public Task<ContentstackResponse> LogoutAsync(string authtoken = null)
public Task<ContentstackResponse> LogoutAsync(string? authtoken = null)
{
string token = authtoken ?? contentstackOptions.Authtoken;
LogoutService logout = new LogoutService(SerializerOptions, token);
Expand Down Expand Up @@ -688,7 +682,7 @@ internal void ClearAllOAuthTokens()
/// </code></pre>
/// </example>
/// <returns>The <see cref="ContentstackResponse"/></returns>
public ContentstackResponse GetUser(ParameterCollection collection = null)
public ContentstackResponse GetUser(ParameterCollection? collection = null)
{
ThrowIfNotLoggedIn();

Expand All @@ -707,7 +701,7 @@ public ContentstackResponse GetUser(ParameterCollection collection = null)
/// </code></pre>
/// </example>
/// <returns>The Task.</returns>
public Task<ContentstackResponse> GetUserAsync(ParameterCollection collection = null)
public Task<ContentstackResponse> GetUserAsync(ParameterCollection? collection = null)
{
ThrowIfNotLoggedIn();

Expand Down
2 changes: 1 addition & 1 deletion Contentstack.Management.Core/ContentstackResponse.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Net.Http;
using System.Threading.Tasks;
using System.Net.Http.Headers;
Expand Down
2 changes: 1 addition & 1 deletion Contentstack.Management.Core/IResponse.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Net;
using System.Text.Json.Nodes;
using Newtonsoft.Json.Linq;
Expand Down
Loading
Loading