{"id":16210248,"url":"https://github.com/bastianblokland/enum-generator-dotnet","last_synced_at":"2026-05-09T04:32:07.031Z","repository":{"id":37997012,"uuid":"183894036","full_name":"BastianBlokland/enum-generator-dotnet","owner":"BastianBlokland","description":"Cli tool for generating a c# / f# / vb / cil enum based on a json input file.","archived":false,"fork":false,"pushed_at":"2022-12-08T04:28:01.000Z","size":142,"stargazers_count":2,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-03-20T11:29:42.098Z","etag":null,"topics":["cil","codegenerator","csharp","enumeration","fsharp","json","visualbasic"],"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/BastianBlokland.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}},"created_at":"2019-04-28T10:34:16.000Z","updated_at":"2022-02-24T21:04:12.000Z","dependencies_parsed_at":"2023-01-25T07:15:07.215Z","dependency_job_id":null,"html_url":"https://github.com/BastianBlokland/enum-generator-dotnet","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"purl":"pkg:github/BastianBlokland/enum-generator-dotnet","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BastianBlokland%2Fenum-generator-dotnet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BastianBlokland%2Fenum-generator-dotnet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BastianBlokland%2Fenum-generator-dotnet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BastianBlokland%2Fenum-generator-dotnet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BastianBlokland","download_url":"https://codeload.github.com/BastianBlokland/enum-generator-dotnet/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BastianBlokland%2Fenum-generator-dotnet/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32807182,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-08T08:22:46.396Z","status":"online","status_checked_at":"2026-05-09T02:00:06.633Z","response_time":123,"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":["cil","codegenerator","csharp","enumeration","fsharp","json","visualbasic"],"created_at":"2024-10-10T10:36:27.379Z","updated_at":"2026-05-09T04:32:07.002Z","avatar_url":"https://github.com/BastianBlokland.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# EnumGenerator-Dotnet\n\n[![Build](https://img.shields.io/azure-devops/build/bastian-blokland/EnumGenerator/5/master.svg)](https://dev.azure.com/bastian-blokland/EnumGenerator/_build/latest?definitionId=5\u0026branchName=master)\n[![Tests](https://img.shields.io/azure-devops/tests/bastian-blokland/EnumGenerator/5/master.svg)](https://dev.azure.com/bastian-blokland/EnumGenerator/_build/latest?definitionId=5\u0026branchName=master)\n[![codecov](https://codecov.io/gh/BastianBlokland/enum-generator-dotnet/branch/master/graph/badge.svg)](https://codecov.io/gh/BastianBlokland/enum-generator-dotnet)\n[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)\n\n| Cli tool | Global tool | Core library |\n|----------|-------------|--------------|\n| [![NuGet](https://img.shields.io/nuget/v/EnumGenerator.Cli.svg)](https://www.nuget.org/packages/EnumGenerator.Cli/) | [![NuGet](https://img.shields.io/nuget/v/EnumGenerator.GlobalTool.svg)](https://www.nuget.org/packages/EnumGenerator.GlobalTool/) | [![NuGet](https://img.shields.io/nuget/v/EnumGenerator.Core.svg)](https://www.nuget.org/packages/EnumGenerator.Core/) |\n\nDotnet cli tool for generating c# / f# / vb / cil enums from json files.\n\n## Description\nIf you have config in json files it can be nice to have a enum to reference in the code instead of\nhaving to hard code values, this tool allows you to generate that enum.\n\n## Usage\nThere are 4 different ways to use the generator:\n\n| Usecase | Project | Documentation |\n|---------|---------|---------------|\n| Build integration | [**Cli**](https://www.nuget.org/packages/EnumGenerator.Cli/) | [Cli Readme](https://github.com/BastianBlokland/enum-generator-dotnet/tree/master/src/EnumGenerator.Cli/readme.md) |\n| Command line | [**GlobalTool**](https://www.nuget.org/packages/EnumGenerator.GlobalTool/) | [GlobalTool Readme](https://github.com/BastianBlokland/enum-generator-dotnet/tree/master/src/EnumGenerator.GlobalTool/readme.md) |\n| Manual library integration | [**Core**](https://www.nuget.org/packages/EnumGenerator.Core/) | [Core Readme](https://github.com/BastianBlokland/enum-generator-dotnet/tree/master/src/EnumGenerator.Core/readme.md) |\n| Unity3D package | [**UnityPackage**](https://github.com/BastianBlokland/enum-generator-unity) | [UnityPackage Readme](https://github.com/BastianBlokland/enum-generator-unity/blob/master/README.md) |\n\n## Json file structure\nTo be able to handle many different file structures the generator takes in a number of [**JsonPath**](https://goessner.net/articles/JsonPath/) entries:\n\n| Argument | Usage |\n|----------|-------|\n| collection | Path to the main collection in the json |\n| entryname | Path to the string name of a single entry in the above collection |\n| entryvalue | Path to the number value of a single entry in the above collection |\n| entrycomment | Path to the string comment of a single entry in the above collection |\n\nNote: If no `entryvalue` is provided the index in the collection will be used as the value.\n\nHere's a couple structure examples:\n* *Outer array*\n\n  json:\n  ```json\n  [\n    {\n      \"name\": \"A\",\n      \"value\": 1\n    },\n    {\n      \"name\": \"B\",\n      \"value\": 2\n    },\n  ]\n  ```\n  options:\n  ```javascript\n  collection = \"[*]\"\n  entryname = \"name\"\n  entryvalue = \"value\"\n  ```\n\n* *Inner array*\n\n  json:\n  ```json\n  {\n    \"entries\": [\n        \"A\",\n        \"B\"\n    ]\n  }\n  ```\n  options:\n  ```javascript\n  collection = \"entries[*]\"\n  entryname = \"$\"\n  ```\n\n* *Inner object*\n\n  json:\n  ```json\n  {\n    \"entries\": [\n      {\n        \"info\": {\n          \"name\": \"A\"\n        },\n        \"value\": 10\n      },\n      {\n        \"info\": {\n          \"name\": \"B\"\n        },\n        \"value\": 20\n      }\n    ]\n  }\n  ```\n  options:\n  ```javascript\n  collection = \"entries[*]\"\n  entryname = \"info.name\"\n  entryvalue = \"value\"\n  ```\n* *Deep search*\n\n  json:\n  ```json\n  {\n    \"collection1\": {\n      \"entries\": [\n        {\n          \"name\": \"A\"\n        },\n        {\n          \"name\": \"B\"\n        }\n      ]\n    },\n    \"collection2\": {\n      \"entries\": [\n        {\n          \"name\": \"C\"\n        },\n        {\n          \"name\": \"D\"\n        }\n      ]\n    }\n  }\n  ```\n  options:\n  ```javascript\n  collection = \"..entries[*]\"\n  entryname = \"name\"\n  entryvalue = \"value\"\n  ```\n\n* *Filtering*\n\n  json:\n  ```json\n  [\n    {\n      \"name\": \"A\",\n      \"value\": 1,\n      \"active\": false\n    },\n    {\n      \"name\": \"B\",\n      \"value\": 2,\n      \"active\": true\n    },\n    {\n      \"name\": \"C\",\n      \"value\": 3,\n      \"active\": true\n    },\n    {\n      \"name\": \"D\",\n      \"value\": 4,\n      \"active\": false\n    }\n  ]\n  ```\n  options:\n  ```javascript\n  collection = \"[?(@.active == true)]\"\n  entryname = \"name\"\n  entryvalue = \"value\"\n  ```\n\nNote: Enable `verbose` logging to get more output about what the mapper is doing.\n\n## Integration example\nAn example can be found in the [**example**](https://github.com/BastianBlokland/enum-generator-dotnet/tree/master/example) directory.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbastianblokland%2Fenum-generator-dotnet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbastianblokland%2Fenum-generator-dotnet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbastianblokland%2Fenum-generator-dotnet/lists"}