{"id":15011604,"url":"https://github.com/zanders3/json","last_synced_at":"2025-05-16T13:03:44.842Z","repository":{"id":47729261,"uuid":"43224794","full_name":"zanders3/json","owner":"zanders3","description":"A really simple C# JSON Parser in 350 lines","archived":false,"fork":false,"pushed_at":"2023-04-29T22:33:47.000Z","size":79,"stargazers_count":330,"open_issues_count":15,"forks_count":89,"subscribers_count":18,"default_branch":"master","last_synced_at":"2025-04-09T08:05:26.889Z","etag":null,"topics":["json-parser","low-memory","nuget","unity-3d"],"latest_commit_sha":null,"homepage":"","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/zanders3.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":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-09-26T22:03:38.000Z","updated_at":"2025-03-28T02:16:59.000Z","dependencies_parsed_at":"2024-06-21T04:31:15.725Z","dependency_job_id":null,"html_url":"https://github.com/zanders3/json","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zanders3%2Fjson","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zanders3%2Fjson/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zanders3%2Fjson/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zanders3%2Fjson/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zanders3","download_url":"https://codeload.github.com/zanders3/json/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254535826,"owners_count":22087398,"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":["json-parser","low-memory","nuget","unity-3d"],"created_at":"2024-09-24T19:41:19.829Z","updated_at":"2025-05-16T13:03:44.779Z","avatar_url":"https://github.com/zanders3.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Tiny Json\n\n[![Build Status](https://travis-ci.org/zanders3/json.png?branch=master)](https://travis-ci.org/zanders3/json)\n[![License](https://img.shields.io/badge/license-MIT-lightgrey.svg)](https://raw.githubusercontent.com/zanders3/json/master/LICENSE)\n[![NuGet](https://img.shields.io/nuget/v/TinyJson.svg)](https://www.nuget.org/packages/TinyJson)\n\nA really simple C# JSON parser in ~350 lines\n- Attempts to parse JSON files with minimal GC allocation\n- Nice and simple `\"[1,2,3]\".FromJson\u003cList\u003cint\u003e\u003e()` API\n- Classes and structs can be parsed too!\n```csharp\nclass Foo \n{ \n  public int Value;\n}\n\"{\\\"Value\\\":10}\".FromJson\u003cFoo\u003e()\n```\n- Anonymous JSON is parsed into `Dictionary\u003cstring,object\u003e` and `List\u003cobject\u003e`\n```csharp\nvar test = \"{\\\"Value\\\":10}\".FromJson\u003cobject\u003e();\nint number = ((Dictionary\u003cstring,object\u003e)test)[\"Value\"];\n```\n- No JIT Emit support to support AOT compilation on iOS\n- Attempts are made to NOT throw an exception if the JSON is corrupted or invalid: returns null instead.\n- Only public fields and property setters on classes/structs will be written to\n- You can *optionally* use `[IgnoreDataMember]` and `[DataMember(Name=\"Foo\")]` to ignore vars and override the default name\n\nLimitations:\n- No JIT Emit support to parse structures quickly\n- Limited to parsing \u003c2GB JSON files (due to int.MaxValue)\n- Parsing of abstract classes or interfaces is NOT supported and will throw an exception.\n\n## Changelog\n\n- v1.1 Support added for Enums and fixed Unity compilation\n- v1.0 Initial Release\n\n## Example Usage\n\nThis example will write a list of ints to a File and read it back again:\n```csharp\nusing System;\nusing System.IO;\nusing System.Collections.Generic;\n\nusing TinyJson;\n\npublic static class JsonTest\n{\n  public static void Main(string[] args)\n  {\n    //Write a file\n    List\u003cint\u003e values = new List\u003cint\u003e { 1, 2, 3, 4, 5, 6 };\n    string json = values.ToJson();\n    File.WriteAllText(\"test.json\", json);\n    \n    //Read it back\n    string fileJson = File.ReadAllText(\"test.json\");\n    List\u003cint\u003e fileValues = fileJson.FromJson\u003cList\u003cint\u003e\u003e();\n  }\n}\n```\nSave this as `JsonTest.cs` then compile and run with `mcs JsonTest.cs \u0026\u0026 mono JsonTest.exe`\n\n## Installation\n\nSimply copy and paste the [JSON Parser](https://raw.githubusercontent.com/zanders3/json/master/src/JSONParser.cs) and/or the [JSON Writer](https://raw.githubusercontent.com/zanders3/json/master/src/JSONWriter.cs) into your project. I also provide NuGet but I recommend the copy paste route ;)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzanders3%2Fjson","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzanders3%2Fjson","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzanders3%2Fjson/lists"}