Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
b1dbc4d
Migrated to newtonsoft.json to System.Text.Json and .NET 10.x support
sunil-lakshman Apr 27, 2026
2c270ee
Merge pull request #58 from contentstack/enh/dx-6423
sunil-lakshman May 4, 2026
98f5777
feat: made changes in version bump for master
OMpawar-21 Jun 9, 2026
0956cce
Merge pull request #65 from contentstack/enhc/beta-to-main-release
OMpawar-21 Jun 9, 2026
76ee7b8
feat: add multi-region endpoint resolution with self-heal regions reg…
OMpawar-21 Jun 10, 2026
42e93b7
Update comment for Local file self-heal
OMpawar-21 Jun 11, 2026
c238c67
Merge pull request #66 from contentstack/enhc/DX-7280
OMpawar-21 Jun 11, 2026
d701bad
fix: replace refresh-region.cs with refresh-region.py
OMpawar-21 Jun 20, 2026
e8f274a
Update Directory.Build.props
OMpawar-21 Jun 20, 2026
a305538
Merge pull request #68 from contentstack/enhc/DX-9232
OMpawar-21 Jun 20, 2026
629e653
Delete issues-jira.yml
Aravind-Kumar-cstk Jun 30, 2026
89348c5
Merge branch 'master' into fix/beta-conflicts
reeshika-h Jul 9, 2026
25f8117
refactor: migrate from Newtonsoft.Json to System.Text.Json in Embedde…
reeshika-h Jul 9, 2026
a94ac91
feat: Update the Read me and version bump for Major Release
OMpawar-21 Jul 10, 2026
42d5327
Update CHANGELOG.md
OMpawar-21 Jul 10, 2026
1f6af0d
Update CHANGELOG.md
OMpawar-21 Jul 10, 2026
590c0c3
Merge pull request #74 from contentstack/fix/beta-conflicts
OMpawar-21 Jul 10, 2026
3a30f9f
Merge pull request #75 from contentstack/enhc/DX-9498
OMpawar-21 Jul 10, 2026
641bfe7
Update CHANGELOG for version 2.0.0
OMpawar-21 Jul 10, 2026
58973ba
Merge pull request #73 from contentstack/beta
naman-contentstack Jul 13, 2026
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
118 changes: 0 additions & 118 deletions .github/workflows/issues-jira.yml

This file was deleted.

3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,5 @@ packages/
*.trx
*/TestResults/
*/app.config
.dccache
.dccache
*/Assets/regions.json
38 changes: 37 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,39 @@
### Version: 2.0.0
#### Date: July-13-2026
- **Breaking:** Replaced **Newtonsoft.Json** with **System.Text.Json** across the package. The `Newtonsoft.Json` package reference is removed; add `System.Text.Json` (or rely on the BCL on supported runtimes) as needed in consuming projects.
- **Breaking:** `GetVariantAliases(JObject, string)` / `GetVariantAliases(JArray, string)` → `GetVariantAliases(JsonObject, string)` / `GetVariantAliases(JsonArray, string)`.
- **Breaking:** `GetVariantMetadataTags(JObject, string)` / `GetVariantMetadataTags(JArray, string)` → `GetVariantMetadataTags(JsonObject, string)` / `GetVariantMetadataTags(JsonArray, string)`.
- **Breaking:** `GetDataCsvariantsAttribute(JObject/JArray, string)` is deprecated and now maps to `JsonObject`/`JsonArray` overloads.
- **Breaking:** `Node.attrs` values are now `System.Text.Json.JsonElement` instead of `Newtonsoft.Json.Linq.JToken` — update `node.attrs["src"].Value<string>()` to `node.attrs["src"].GetString()`.
- **Breaking:** Model classes use `[JsonPropertyName]` instead of `[JsonProperty]`.
- **Breaking:** Requires **.NET 10** or later (previously netstandard2.0 / net6.0).
- **New:** Multi-region endpoint resolution via `Endpoint.GetContentstackEndpoint(region, service)` — resolves Contentstack service URLs for all 7 supported regions (NA, EU, AU, Azure-NA, Azure-EU, GCP-NA, GCP-EU) and 18 service keys (contentDelivery, contentManagement, auth, graphqlDelivery, preview, images, assets, automate, launch, developerHub, brandKit, genAI, personalizeManagement, personalizeEdge, composableStudio, assetManagement, and more).
- **New:** `Utils.GetContentstackEndpoint(region, service)` proxy — access endpoint resolution directly from the `Utils` class without importing `Contentstack.Utils.Endpoints`.
- **New:** `omitHttps` flag strips the `https://` scheme from returned URLs — pass directly to SDK host configuration (e.g. `new ContentstackOptions { Host = Endpoint.GetContentstackEndpoint("eu", "contentDelivery", omitHttps: true) }`).
- **New:** Case-insensitive region alias support — `"us"`, `"NA"`, `"AWS-NA"`, `"azure_na"` all resolve correctly to the same region.
- **New:** `regions.json` registry auto-downloaded from `artifacts.contentstack.com` on first use and cached on disk — no setup required. The SDK self-heals if the file is missing.
- **New:** `Scripts/refresh-region.py` bundled inside the NuGet package — automatically placed in your project's `Scripts/` folder on first `dotnet build`. Run `python3 Scripts/refresh-region.py` (Mac/Linux) or `python Scripts/refresh-region.py` (Windows) anytime to pull the latest regions from CDN.

##### Migration Guide:
- See [Migrating from Newtonsoft.Json to System.Text.Json](https://www.contentstack.com/docs/developers/sdks/utils-sdk/dot-net/migrate-dotnet-utils-sdk-from-newtonsoft.json-to-system.text.json) for the full upgrade path from v1.x.

### Version: 2.0.0-beta.2
#### Date: June-22-2026
- **New:** Multi-region endpoint resolution via `Endpoint.GetContentstackEndpoint(region, service)` — resolves Contentstack service URLs for all 7 supported regions (NA, EU, AU, Azure-NA, Azure-EU, GCP-NA, GCP-EU) and 18 service keys (contentDelivery, contentManagement, auth, graphqlDelivery, preview, images, assets, automate, launch, developerHub, brandKit, genAI, personalizeManagement, personalizeEdge, composableStudio, assetManagement, and more).
- **New:** `Utils.GetContentstackEndpoint(region, service)` proxy — access endpoint resolution directly from the `Utils` class without importing `Contentstack.Utils.Endpoints`.
- **New:** `omitHttps` flag strips the `https://` scheme from returned URLs — pass directly to SDK host configuration (e.g. `new ContentstackOptions { Host = Endpoint.GetContentstackEndpoint("eu", "contentDelivery", omitHttps: true) }`).
- **New:** Case-insensitive region alias support — `"us"`, `"NA"`, `"AWS-NA"`, `"azure_na"` all resolve correctly to the same region.
- **New:** `regions.json` registry auto-downloaded from `artifacts.contentstack.com` on first use and cached on disk — no setup required. The SDK self-heals if the file is missing.
- **New:** `Scripts/refresh-region.py` bundled inside the NuGet package — automatically placed in your project's `Scripts/` folder on first `dotnet build`. Run `python3 Scripts/refresh-region.py` (Mac/Linux) or `python Scripts/refresh-region.py` (Windows) anytime to pull the latest regions from CDN.

### Version: 2.0.0-beta.1
#### Date: April-27-2026
- **Breaking:** Replaced **Newtonsoft.Json** with **System.Text.Json** across the package. The `Newtonsoft.Json` package reference is removed; add `System.Text.Json` (or rely on the BCL on supported runtimes) as needed in consuming projects.
- **Breaking:** Variant metadata APIs that previously took `JObject` / `JArray` now use `System.Text.Json.Nodes.JsonObject` and `JsonArray` (`GetVariantAliases`, `GetVariantMetadataTags`, and obsolete `GetDataCsvariantsAttribute` overloads).
- JSON serialization uses the same model attributes with `System.Text.Json.Serialization` (`JsonPropertyName`, `JsonConverter`), including custom converters for RTE/GQL-shaped JSON and **path-mapped** embedded models (`PathMappedJsonConverter<T>`).
- RTE JSON deserialization tolerates **trailing commas** when using the documented test/helper patterns (`AllowTrailingCommas`); attribute dictionaries may surface **`JsonElement`** values instead of boxed strings—use helpers or unwrap explicitly if you access `Node.attrs` directly.
- Internal: `LangVersion` set to **latest** for multi-target builds; utilities normalize attribute values where the HTML pipeline expects strings.

### Version: 1.4.0
#### Date: June-23-2026
- Added `EmbeddedObject` as a concrete implementation of `IEmbeddedObject`, covering both `IEmbeddedEntry` and `IEmbeddedAsset`.
Expand All @@ -13,7 +49,7 @@
- Added configurable locale casing through `AddEditableTagsOptions.UseLowerCaseLocale`.
- Added unit tests for Live Preview editable tags.


### Version: 1.2.0
#### Date: March-31-2026
- Added `GetVariantMetadataTags(JObject, string)` and `GetVariantMetadataTags(JArray, string)` as the canonical API for building the `data-csvariants` payload (same behavior as the previous helpers).

Expand Down
3 changes: 1 addition & 2 deletions Contentstack.Utils.Tests/Contentstack.Utils.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net7.0</TargetFrameworks>
<TargetFrameworks>net10.0</TargetFrameworks>

<IsPackable>false</IsPackable>
<ReleaseVersion>$(Version)</ReleaseVersion>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.13.0" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.4" />
<PackageReference Include="coverlet.collector" Version="6.0.4">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
Expand Down
7 changes: 4 additions & 3 deletions Contentstack.Utils.Tests/DefaultRenderTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using Contentstack.Utils.Tests.Helpers;
using Contentstack.Utils.Tests.Constants;
using System;
using Contentstack.Utils;

namespace Contentstack.Utils.Tests
{
Expand Down Expand Up @@ -178,9 +179,9 @@ public void testLinkhDocument()

string result = defaultRender.RenderNode("a", nodeLink, (nodes) => { return text; });

string url = nodeLink.attrs.ContainsKey("url") ? (string)nodeLink.attrs["url"] : "";
string target = nodeLink.attrs.ContainsKey("target") ? (string)nodeLink.attrs["target"] : "";
string title = nodeLink.attrs.ContainsKey("title") ? (string)nodeLink.attrs["title"] : "";
string url = nodeLink.attrs.ContainsKey("url") ? JsonAttrValue.AsString(nodeLink.attrs["url"]) : "";
string target = nodeLink.attrs.ContainsKey("target") ? JsonAttrValue.AsString(nodeLink.attrs["target"]) : "";
string title = nodeLink.attrs.ContainsKey("title") ? JsonAttrValue.AsString(nodeLink.attrs["title"]) : "";

Assert.Equal($"<a href=\"{url}\" target=\"{target}\" title=\"{title}\" >Text To set Link</a>", result);
}
Expand Down
Loading
Loading