{"id":16678933,"url":"https://github.com/joncloud/jsonificate","last_synced_at":"2026-04-21T23:03:02.426Z","repository":{"id":78825255,"uuid":"332369549","full_name":"joncloud/jsonificate","owner":"joncloud","description":"Jsonificate is a set of extensions for System.Text.Json","archived":false,"fork":false,"pushed_at":"2021-09-20T17:15:01.000Z","size":98,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"publish","last_synced_at":"2026-02-18T23:40:16.069Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/joncloud.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-01-24T04:50:18.000Z","updated_at":"2025-05-30T12:05:56.000Z","dependencies_parsed_at":null,"dependency_job_id":"6fdde1fc-8f77-4c62-af78-cedfb9812aff","html_url":"https://github.com/joncloud/jsonificate","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/joncloud/jsonificate","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joncloud%2Fjsonificate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joncloud%2Fjsonificate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joncloud%2Fjsonificate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joncloud%2Fjsonificate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/joncloud","download_url":"https://codeload.github.com/joncloud/jsonificate/tar.gz/refs/heads/publish","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joncloud%2Fjsonificate/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32113748,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-21T11:25:29.218Z","status":"ssl_error","status_checked_at":"2026-04-21T11:25:28.499Z","response_time":128,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-12T13:32:19.954Z","updated_at":"2026-04-21T23:03:02.409Z","avatar_url":"https://github.com/joncloud.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Jsonificate\n\n[![NuGet](https://img.shields.io/nuget/v/Jsonificate.svg)](https://www.nuget.org/packages/Jsonificate/)\n![.NET](https://github.com/joncloud/jsonificate/workflows/.NET/badge.svg)\n\n## Description\n\nJsonificate is a set of extensions for System.Text.Json. Most notably:\n\n* Deep Cloning objects\n* Serializing objects with [ObjectPools](https://www.nuget.org/packages/Microsoft.Extensions.ObjectPool/)\n\n## Licensing\n\nReleased under the MIT License.  See the [LICENSE](LICENSE.md) file for further details.\n\n## Getting started\n\nSetup your project by adding a package reference:\n\n```bash\ndotnet add package Jsonificate\n```\n\n### Deep Cloning Objects\n\nUse the extension method for `JsonSerializerOptions` in order to create a new cloner instance: `System.Text.Json.JsonSerializerOptionsExtensions.CreateCloner`. For more details, check out [DeepCloningObjects](./samples/ReadmeSamples/DeepCloningObjects.cs).\n\n```csharp\nusing System;\nusing System.Text.Json;\n\n// Setup options your way.\nvar options = new JsonSerializerOptions();\n\nvar cloner = options.CreateCloner();\n\nvar original = new Point { X = 10, Y = 53 };\nvar clone = cloner.Clone(original);\n\nConsole.WriteLine($\"Original: {original}\");\nConsole.WriteLine($\"Clone: {clone}\");\nConsole.WriteLine(object.ReferenceEquals(original, clone));\n```\n\nAnd the expected results:\n\n```bash\nOriginal: (10, 53)\nClone: (10, 53)\nFalse\n```\n\n### Working with Object Pools\n\nAugment an existing `JsonSerializerOptions` by adding an `ObjectPool\u003cT\u003e` to it with the extension method `System.Text.Json.JsonSerializerOptionsExtensions.AddPoolingConverter`. For more details, check out [WorkingWithObjectPools](./samples/ReadmeSamples/WorkingWithObjectPools.cs).\n\n```csharp\nusing Microsoft.Extensions.ObjectPool;\n\n// Create your own pools\nObjectPool\u003cPoint\u003e pool = ...;\n\nvar options = new JsonSerializerOptions()\n  .AddPoolingConverter(pool);\n\nstring json = \"{\\\"X\\\":10,\\\"Y\\\":53}\";\n\nvar p = JsonSerializer.Deserialize\u003cPoint\u003e(json, options);\n\nDoWork(p);\n\npool.Return(p);\n```\n\n#### Custom Converters and Object Pools\n\nUsing a top-level object that does not require a custom converter will keep thing simple, however when this cannot be achieved `Jsonificate.PoolingJsonConverter` can be overridden. For more details, check out [WorkingWithObjectPoolsCustomConverter](./samples/ReadmeSamples/WorkingWithObjectPoolsCustomConverter.cs).\n\n```csharp\n\nObjectPool\u003cPoint\u003e pool = ...;\n\nvar options = new JsonSerializerOptions();\noptions.Converters.Add(new PointPoolingJsonConverter(pool, options));\n\npublic class Point\n{\n  public int X { get; set; }\n  public int Y { get; set; }\n}\n\npublic class PointPoolingJsonConverter : PoolingJsonConverter\u003cPoint\u003e\n{\n  public PointPoolingJsonConverter(ObjectPool\u003cPoint\u003e pool, JsonSerializerOptions options)\n    : base(pool, options)\n  {\n  }\n\n  protected override void Populate(ref Utf8JsonReader reader, Type typeToConvert, Point value, JsonSerializerOptions options)\n  {\n    if (reader.TokenType != JsonTokenType.StartArray)\n    {\n      throw new JsonException();\n    }\n\n    value.X = reader.Read() ? reader.GetInt32() : throw new JsonException();\n    value.Y = reader.Read() ? reader.GetInt32() : throw new JsonException();\n\n    if (!reader.Read() || reader.TokenType != JsonTokenType.EndArray)\n    {\n      throw new JsonException();\n    }\n  }\n\n  public override void Write(Utf8JsonWriter writer, Point value, JsonSerializerOptions options)\n  {\n    writer.WriteStartArray();\n    writer.WriteNumberValue(value.X);\n    writer.WriteNumberValue(value.Y);\n    writer.WriteEndArray();\n  }\n}\n```\n\n### More Samples\n\n* [Integrating with ASP.NET Core](./samples/AspNetCoreSamples)\n* [Integrating with SignalR](./samples/SignalRSamples)\n\n## Building the solution\n\nThe majority of the GitHub Actions steps are available through [actions](./actions), and can be invoked to replicate the behavior.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoncloud%2Fjsonificate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjoncloud%2Fjsonificate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoncloud%2Fjsonificate/lists"}