{"id":17453506,"url":"https://github.com/scalablecory/system-text-json-samples","last_synced_at":"2026-04-16T19:38:58.076Z","repository":{"id":80888813,"uuid":"193411016","full_name":"scalablecory/system-text-json-samples","owner":"scalablecory","description":"System.Text.Json samples","archived":false,"fork":false,"pushed_at":"2019-07-05T21:55:31.000Z","size":12,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-28T04:36:58.800Z","etag":null,"topics":["dotnet","dotnet-core","dotnet-core3","json","system-text-json"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/scalablecory.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"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":"2019-06-24T00:58:55.000Z","updated_at":"2021-02-16T20:59:38.000Z","dependencies_parsed_at":null,"dependency_job_id":"81906341-4a1e-4d8b-8a3c-c96ba1765516","html_url":"https://github.com/scalablecory/system-text-json-samples","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/scalablecory/system-text-json-samples","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scalablecory%2Fsystem-text-json-samples","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scalablecory%2Fsystem-text-json-samples/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scalablecory%2Fsystem-text-json-samples/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scalablecory%2Fsystem-text-json-samples/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/scalablecory","download_url":"https://codeload.github.com/scalablecory/system-text-json-samples/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scalablecory%2Fsystem-text-json-samples/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273703441,"owners_count":25153000,"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-05T02:00:09.113Z","response_time":402,"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":["dotnet","dotnet-core","dotnet-core3","json","system-text-json"],"created_at":"2024-10-18T00:43:03.010Z","updated_at":"2026-04-16T19:38:57.998Z","avatar_url":"https://github.com/scalablecory.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# System.Text.Json Samples\n\nSystem.Text.Json is a high-performance JSON API added in .NET Core 3.\n\nThis looks at how one might use its various features.\n\nSample data used: http://data.consumerfinance.gov/api/views.json\n\n## JsonSerializer\n\nTODO.\n\n## JsonDocument\n\nTODO.\n\n## Utf8JsonReader\n\n`Utf8JsonReader` is a pull parser similar to `XmlReader`. It is a bit low-level, presenting the document as a stream of tokens that you must interpret.\n\n### Parsing synchronously\n\n`Complaint.Read` implements a synchronous parser on top of `ReadOnlySpan`.\n\nThis is the simplest parser you can write on top of `Utf8JsonReader`, with each \"object\" being parsed in its own method and a clear call stack as you go through the document.\n\n### Parsing asynchronously\n\n`Complaint.ReadAsync` implements an asynchronous parser on top of `Stream`.\n\nThis does not load the entire `Stream` into memory: instead, it is parsed in reasonably sized chunks. We must handle the case where `Utf8JsonReader` has exhausted the current buffer, and read the next chunk. Because `Utf8JsonReader` is a `ref struct`, we can not use it in an `async` method and must instead implement our own state machine manually. This makes things a bit harder to follow.\n\nThis is implemented via a resumable, I/O-agnostic parser `ComplaintParser` that is passed to one of three methods which handle the I/O:\n* See [JsonParser.Memory.cs](json-test/JsonParser.Memory.cs) for a simple `Span`-based implementation that uses that parser.\n* See [JsonParser.ParseSimpleAsync.cs](json-test/JsonParser.ParseSimpleAsync.cs) for a `Stream`-based implementation that implements trivial copy \u0026 grow buffering.\n* See [Jsonparser.ParseNoCopyAsync.cs](json-test/JsonParser.ParseNoCopyAsync.cs) for a `Stream`-based implementation that implements sequences to avoid copying when growing buffers.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscalablecory%2Fsystem-text-json-samples","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fscalablecory%2Fsystem-text-json-samples","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscalablecory%2Fsystem-text-json-samples/lists"}