{"id":22231454,"url":"https://github.com/danielwertheim/jsonnet-contractresolvers","last_synced_at":"2025-09-18T23:38:20.104Z","repository":{"id":53496151,"uuid":"164323119","full_name":"danielwertheim/jsonnet-contractresolvers","owner":"danielwertheim","description":"Custom contract resolvers for Newtonsoft JSON.Net, supporting e.g. private setters and private constructors.","archived":false,"fork":false,"pushed_at":"2022-12-08T15:13:57.000Z","size":31,"stargazers_count":14,"open_issues_count":3,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-09-04T15:59:01.746Z","etag":null,"topics":["csharp","dotnet","json-net","jsonnet","newtonsoft-json"],"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/danielwertheim.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-01-06T16:06:12.000Z","updated_at":"2024-03-27T14:05:30.000Z","dependencies_parsed_at":"2023-01-25T14:31:20.432Z","dependency_job_id":null,"html_url":"https://github.com/danielwertheim/jsonnet-contractresolvers","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/danielwertheim/jsonnet-contractresolvers","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danielwertheim%2Fjsonnet-contractresolvers","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danielwertheim%2Fjsonnet-contractresolvers/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danielwertheim%2Fjsonnet-contractresolvers/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danielwertheim%2Fjsonnet-contractresolvers/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/danielwertheim","download_url":"https://codeload.github.com/danielwertheim/jsonnet-contractresolvers/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danielwertheim%2Fjsonnet-contractresolvers/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":275852425,"owners_count":25540137,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-18T02:00:09.552Z","response_time":77,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["csharp","dotnet","json-net","jsonnet","newtonsoft-json"],"created_at":"2024-12-03T01:26:35.771Z","updated_at":"2025-09-18T23:38:20.036Z","avatar_url":"https://github.com/danielwertheim.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# JsonNet.ContractResolvers\n[![NuGet](https://img.shields.io/nuget/v/JsonNet.ContractResolvers.svg?cacheSeconds=3600)](https://www.nuget.org/packages/JsonNet.ContractResolvers)\n[![License MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://choosealicense.com/licenses/mit/)\n[![Build Status](https://dev.azure.com/daniel-wertheim/os/_apis/build/status/jsonnet-contractresolvers-CI?branchName=master)](https://dev.azure.com/daniel-wertheim/os/_build/latest?definitionId=11\u0026branchName=master)\n\nTiny solution providing pre-made `ContractResolver` implementations for [Newtonsoft.Json](https://github.com/JamesNK/Newtonsoft.Json), resolvers that supports private property setters and private constructors.\n\n## Replaces eariler repos and NuGets\nPrevious repo and NuGet distributions that this repo replaces are:\n\n- https://github.com/danielwertheim/jsonnet-privatesetterscontractresolvers\n- https://www.nuget.org/packages/JsonNet.PrivateSettersContractResolvers/\n- https://www.nuget.org/packages/JsonNet.PrivateSettersContractResolvers.Source/\n\n## Usage\n\n```\nInstall-Package JsonNet.ContractResolvers\n```\n\nAfter that, you just consume it by creating an instance of either:\n\n- `PrivateSetterContractResolver` - extends `DefaultContractResolver` with support for private setters.\n- `PrivateSetterAndCtorContractResolver`- extends `DefaultContractResolver` with support for private setters and private constructors.\n- `PrivateSetterCamelCasePropertyNamesContractResolver` - extends `CamelCasePropertyNamesContractResolver` with support for private setters.\n- `PrivateSetterAndCtorCamelCasePropertyNamesContractResolver`- extends `CamelCasePropertyNamesContractResolver` with support for private setters and private constructors.\n\nwhich you then assign to the `JsonSerializerSettings.ContractResolver`.\n\n```csharp\nvar settings = new JsonSerializerSettings\n{\n    ContractResolver = new PrivateSetterContractResolver()\n};\n\nvar model = JsonConvert.DeserializeObject\u003cModel\u003e(json, settings);\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanielwertheim%2Fjsonnet-contractresolvers","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdanielwertheim%2Fjsonnet-contractresolvers","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanielwertheim%2Fjsonnet-contractresolvers/lists"}