From 820d16ca9e533c11971cae41e5cd41e09307ab68 Mon Sep 17 00:00:00 2001 From: OMpawar-21 Date: Fri, 10 Jul 2026 09:41:46 +0530 Subject: [PATCH] feat: Update the Read me and version bump for Major Release --- CHANGELOG.md | 37 ++++++++++++++++++++++ Contentstack.Core/Contentstack.Core.csproj | 2 +- Contentstack.Core/ContentstackClient.cs | 3 +- Directory.Build.props | 2 +- README.md | 32 +++++++++++++++++++ 5 files changed, 73 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index aa500fa5..01ce7653 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,40 @@ +### Version: 3.0.0 +#### Date: Jul-13-2026 + +##### Breaking Changes: +- Removed `Newtonsoft.Json` dependency; all JSON serialisation now uses `System.Text.Json` (BCL) +- `Entry.ToJson()`, `Query.Count()`, `AssetLibrary.Count()` now return `JsonObject` instead of `JObject` +- `AssetLibrary.Query(JsonObject)` — parameter type changed from `JObject` to `JsonObject` +- `ContentType.Fetch()`, `GlobalField.Fetch()`, `GlobalFieldQuery.Find()` now return `JsonObject` instead of `JObject` +- `SerializerSettings` → `SerializerOptions` +- Model classes use `[JsonPropertyName]` instead of `[JsonProperty]` +- Requires **.NET 10** or later +- Updated `contentstack.utils` dependency to `2.0.0` (final, non-beta) + +##### Feat: +- Added `Endpoint` class for dynamic region-to-URL resolution via CDN-backed `regions.json` +- Added `ContentstackRegionMap` to map `ContentstackRegion` enum to registry region IDs +- Added `GCP_EU` region support +- Added `ApiErrorBodyParser` for consistent API error envelope parsing +- Added `JsonNodeConversion` and `JsonObjectMerge` utilities to replace Newtonsoft equivalents +- Added `ContentstackJsonDefaults` — shared `JsonSerializerOptions` used across all custom converters + +##### Enh: +- `Config.BaseUrl` now resolves hosts from the regions registry; removed hardcoded `regionCode()` and `HostURL` +- Replaced `Console.WriteLine` with `Debug.WriteLine` in `ContentstackConvert` to suppress parse warnings from application stdout + +##### Chore: +- Replaced `refresh-region.cs` with `refresh-region.py` — avoids MSBuild compiling the script as source +- Added `build/contentstack.csharp.targets` to auto-deliver `refresh-region.py` to consumer projects on first build +- Added `Assets/regions.json` to `.gitignore` +- Added `EndpointTest.cs` +- Updated .NET version in SCA scan CI from `7.0.x` to `10.0.x` + +##### Migration Guide: +- See [Migrating from Newtonsoft.Json to System.Text.Json](https://www.contentstack.com/docs/developers/sdks/content-delivery-sdk/dot-net/migrate-dotnet-delivery-sdk-from-newtonsoft.json-to-system.text.json) for the full upgrade path from v2.x. + +--- + ### Version: 3.0.0-beta.2 #### Date: Jun-22-2026 diff --git a/Contentstack.Core/Contentstack.Core.csproj b/Contentstack.Core/Contentstack.Core.csproj index d1270479..c602db54 100644 --- a/Contentstack.Core/Contentstack.Core.csproj +++ b/Contentstack.Core/Contentstack.Core.csproj @@ -32,7 +32,7 @@ - + diff --git a/Contentstack.Core/ContentstackClient.cs b/Contentstack.Core/ContentstackClient.cs index 03437344..3e2b3901 100644 --- a/Contentstack.Core/ContentstackClient.cs +++ b/Contentstack.Core/ContentstackClient.cs @@ -13,6 +13,7 @@ using System.Text.Json; using System.Text.Json.Nodes; using System.Text.Json.Serialization; +using Contentstack.Utils.Converters; namespace Contentstack.Core { @@ -150,7 +151,7 @@ public ContentstackClient(IOptions options) } // Handles deserialization of embedded entries and assets in _embedded_items responses. - SerializerSettings.Converters.Add(new EmbeddedObjectConverter()); + SerializerOptions.Converters.Add(new EmbeddedObjectConverter()); } public ContentstackClient(ContentstackOptions options) : diff --git a/Directory.Build.props b/Directory.Build.props index e41df74e..1f737f6c 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -1,5 +1,5 @@ - 3.0.0-beta.2 + 3.0.0 diff --git a/README.md b/README.md index ea063835..01f0a749 100644 --- a/README.md +++ b/README.md @@ -7,6 +7,13 @@ This guide will help you get started with our .NET SDK to build apps powered by Contentstack. +## Prerequisites +To get started with .NET, you will need the following: + +- .NET 10 or later + +> **Migrating from v2.x?** Version 3.0.0 replaces Newtonsoft.Json with System.Text.Json and changes several public API return/parameter types (e.g. `Entry.ToJson()`, `Query.Count()` now return `JsonObject` instead of `JObject`). See the [migration guide](https://www.contentstack.com/docs/developers/sdks/content-delivery-sdk/dot-net/migrate-dotnet-delivery-sdk-from-newtonsoft-to-stj) before upgrading. + ## SDK Installation and Setup To use the .NET SDK, download it from here @@ -99,6 +106,31 @@ query.Find().ContinueWith((t) => { } }); ``` +## Endpoint Resolution + +Use the `Endpoint` class to resolve Contentstack service URLs for any supported region without hardcoding hosts. This is useful when configuring `ContentstackOptions` for a specific region, including the newly added `gcp-eu` region. + +``` cs +using Contentstack.Core.Endpoints; // Endpoint + +// Resolve the Content Delivery endpoint for a region +string url = Endpoint.GetContentstackEndpoint("us", "contentDelivery"); +// → "https://cdn.contentstack.io" + +// GCP-EU region support +string gcpEuUrl = Endpoint.GetContentstackEndpoint("gcp-eu", "contentDelivery"); + +// Strip the https:// scheme — useful when passing the host directly to SDK configuration +var options = new ContentstackOptions() +{ + ApiKey = "", + DeliveryToken = "", + Environment = "", + Host = Endpoint.GetContentstackEndpoint("eu", "contentDelivery", omitHttps: true) +}; +ContentstackClient stack = new ContentstackClient(options); +``` + ## API Reference Go through our .NET SDK API Reference guide to know about the methods that can be used to query your content in Contentstack.