Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Convert JSON to any language!

License

NotificationsYou must be signed in to change notification settings

RiversideValley/JsonBinder

Repository files navigation

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 theRiverside.JsonBinder namespace and call the static methodJsonSerializer.ConvertTo:

usingRiverside.JsonBinder;stringjson="{\"Name\":\"John\",\"Age\": 30 }";stringresult=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 theRiverside.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 inred and returns to the main menu.

📋 Requirements

  • Any version of .NET
  • Basic understanding of JSON and object-oriented programming.

⚖️ License

This project, including the libraryRiverside.JsonBinder, is licensed under theMIT 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.


[8]ページ先頭

©2009-2025 Movatter.jp