{"id":17081489,"url":"https://github.com/benfoster/o9d-json","last_synced_at":"2025-04-12T21:11:17.363Z","repository":{"id":46911006,"uuid":"408607807","full_name":"benfoster/o9d-json","owner":"benfoster","description":"Extensions for System.Text.Json","archived":false,"fork":false,"pushed_at":"2024-07-09T21:25:56.000Z","size":26,"stargazers_count":10,"open_issues_count":2,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-10T10:13:46.826Z","etag":null,"topics":["dotnet","json","snake-case"],"latest_commit_sha":null,"homepage":"https://benfoster.github.io/o9d-json/","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/benfoster.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null}},"created_at":"2021-09-20T21:38:19.000Z","updated_at":"2023-10-17T05:45:19.000Z","dependencies_parsed_at":"2022-09-02T18:42:25.174Z","dependency_job_id":null,"html_url":"https://github.com/benfoster/o9d-json","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benfoster%2Fo9d-json","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benfoster%2Fo9d-json/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benfoster%2Fo9d-json/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benfoster%2Fo9d-json/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/benfoster","download_url":"https://codeload.github.com/benfoster/o9d-json/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248631676,"owners_count":21136562,"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","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":["dotnet","json","snake-case"],"created_at":"2024-10-14T12:53:17.594Z","updated_at":"2025-04-12T21:11:17.331Z","avatar_url":"https://github.com/benfoster.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cimg alt=\"Json Icon\" src=\"src/Json.Formatting/assets/icon.png\" width=\"64px\" /\u003e\n\n# JSON Extensions\n\n[![NuGet](https://img.shields.io/nuget/v/O9d.Json.Formatting.svg)](https://www.nuget.org/packages/O9d.Json.Formatting) \n[![NuGet](https://img.shields.io/nuget/dt/O9d.Json.Formatting.svg)](https://www.nuget.org/packages/O9d.Json.Formatting)\n[![License](https://img.shields.io/:license-mit-blue.svg)](https://benfoster.mit-license.org/)\n\n![Build](https://github.com/benfoster/o9d-json/workflows/Build/badge.svg)\n[![Coverage Status](https://coveralls.io/repos/github/benfoster/o9d-json/badge.svg?branch=main)](https://coveralls.io/github/benfoster/o9d-json?branch=main)\n[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=benfoster_o9d-json\u0026metric=alert_status)](https://sonarcloud.io/dashboard?id=benfoster_o9d-json)\n\n\nExtensions for [System.Text.Json](https://docs.microsoft.com/en-us/dotnet/api/system.text.json?view=net-5.0).\n\n## Quick Start\n\nAdd the O9d.Json.Formatting package from [NuGet](https://www.nuget.org/packages/O9d.Json.Formatting)\n\n```\ndotnet add package O9d.Json.Formatting\n```\n\nIf you want to use a pre-release package, you can download them GitHub packages.\n\n## Features\n\n### Snake Case Formatting\n\nThis O9d.Json.Formatting library adds support for snake_case formatting to System.Text.Json which is [still missing](https://github.com/dotnet/runtime/issues/782). The included implementation originates from the [Newtonsoft.Json](https://github.com/JamesNK/Newtonsoft.Json) project.\n\nTo configure snake case formatting when using `JsonSerializer` directly:\n\n```c#\nvar options = new JsonSerializerOptions()\n{\n    PropertyNamingPolicy = new JsonSnakeCaseNamingPolicy()\n};\n\nstring json = JsonSerializer.Serialize(someObj, options);\n```\n\nTo configure snake case formatting in an ASP.NET Core MVC project:\n\n```c#\nservices.AddControllers()\n    .AddJsonOptions(options =\u003e \n    {\n        options.JsonSerializerOptions.PropertyNamingPolicy = new JsonSnakeCaseNamingPolicy()\n    });\n```\n\nOr in ASP.NET 6.0 Minimal APIs:\n\n```c#\nbuilder.Services.Configure\u003cJsonOptions\u003e(options =\u003e\n{\n    options.SerializerOptions.PropertyNamingPolicy = new JsonSnakeCaseNamingPolicy());\n});\n```\n\n### Pre-release Packages\n\nPre-release packages can be downloaded from [GitHub Packages](https://github.com/benfoster?tab=packages\u0026repo_name=o9d-json).\n\n```\ndotnet add package O9d.Json.Formatting --prerelease --source https://nuget.pkg.github.com/benfoster/index.json\n```\n\n[More information](https://docs.github.com/en/packages/guides/configuring-dotnet-cli-for-use-with-github-packages) on using GitHub packages with .NET.\n\n## Building locally \n\nThis project uses [Cake](https://cakebuild.net/) to build, test and publish packages. \n\nRun `build.sh` (Mac/Linux) or `build.ps1` (Windows) To build and test the project. \n\nThis will output NuGet packages and coverage reports in the `artifacts` directory.\n\n## Contributing\n\nTo contribute to O9d.Json, fork the repository and raise a PR. If your change is substantial please [open an issue](https://github.com/benfoster/o9d-json/issues) first to discuss your objective.\n\n## Docs\n\nThe JSON documentation is built using [DocFx](https://dotnet.github.io/docfx/). To build and serve the docs locally run:\n\n```\n./build.sh --target ServeDocs\n```\n\nThis will serve the docs on http://localhost:8080.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbenfoster%2Fo9d-json","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbenfoster%2Fo9d-json","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbenfoster%2Fo9d-json/lists"}