https://github.com/riversidevalley/jsonbinder
Convert JSON to any language!
https://github.com/riversidevalley/jsonbinder
csharp csharp-library dotnet dotnet-library json json-parser riverside riversidevalley
Last synced: 11 months ago
JSON representation
Convert JSON to any language!
- Host: GitHub
- URL: https://github.com/riversidevalley/jsonbinder
- Owner: RiversideValley
- License: mit
- Created: 2025-01-17T07:37:54.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-02-02T19:05:56.000Z (over 1 year ago)
- Last Synced: 2025-07-09T03:38:50.324Z (11 months ago)
- Topics: csharp, csharp-library, dotnet, dotnet-library, json, json-parser, riverside, riversidevalley
- Language: C#
- Homepage: https://riversidevalley.github.io/JsonBinder/
- Size: 115 KB
- Stars: 4
- Watchers: 2
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: docs/README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# 🧩 `Riverside.JsonBinder`
`Riverside.JsonBinder` is a .NET based library that generates language-specific class representations from JSON input. It supports multiple programming languages.
## ✨ Features
- Converts JSON into class representations for:
- C#, Python, Java, JavaScript, TypeScript, PHP, Ruby, and Swift.
- Multi-language selection for simultaneous generation.
- User-friendly interface with detailed error handling.
## 🛠️ Usage
### 📚 Using the Library
To use the library in your .NET project, include the `Riverside.JsonBinder` namespace and call the static method `JsonSerializer.ConvertTo`:
```csharp
using Riverside.JsonBinder;
string json = "{ \"Name\": \"John\", \"Age\": 30 }";
string result = JsonSerializer.ConvertTo(json, SerializableLanguage.CSharp);
Console.WriteLine(result);
```
This method takes two parameters:
1. `json`: A string containing the JSON input.
2. `language`: An enum specifying the target SerializableLanguage
Supported languages include:
- `SerializableLanguage.CSharp`
- `SerializableLanguage.Python`
- `SerializableLanguage.Java`
- `SerializableLanguage.JavaScript`
- `SerializableLanguage.TypeScript`
- `SerializableLanguage.PHP`
- `SerializableLanguage.Ruby`
- `SerializableLanguage.Swift`
You can use the output directly in your projects or customize it as needed.
## 🚀 Running the Test Program
To see the library in action:
1. Compile the solution using your chosen TFM.
2. Run the `Riverside.JsonBinder.Console` project.
3. Use the interactive menu to input JSON and select target languages.
The program will display the generated classes for the chosen languages in an organized format.
- ❌ Invalid JSON displays an error in **red** and returns to the main menu.
### 📋 Requirements
- Any version of .NET
- Basic understanding of JSON and object-oriented programming.
## ⚖️ License
This project, including the library `Riverside.JsonBinder`, is licensed under the **MIT License**. You are free to use, modify, and distribute the software, provided you adhere to the terms of the license.
---
***Crafted with the help of AI magic.***
*GPT4o & Claude 3.5 Sonnet.*