Skip to content

An excellent tool for converting json files to structs or classes in any programming language.

License

Notifications You must be signed in to change notification settings

ez4o/convert-json-cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

56 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Contributors Forks Stargazers MIT License Issues Issues Closed


convert-json-cli


Table of Contents
  1. About The Project Supported Languages
  2. Getting Started
  3. Set Up Your Own
  4. Roadmap
  5. Contributing
  6. License
  7. Contact

About The Project

screenshot-1

Convert-JSON-CLI is an excellent tool for converting json files to structs or classes in any programming language.

It currently only supports command line interface, but a web version will be developed in the near future!

(back to top)

Supported Languages


Getting Started

Download

Download latest executable files via: https://github.com/ez4o/convert-json-cli/releases.

Usage

convjson [OPTIONS] [INPUT_FILE_PATH] [TARGET_LANGUAGE]

Parameters

Parameter Necessity Description Default Value
INPUT_FILE_PATH Required Path to your JSON file. None
TARGET_LANGUAGE Required Target language. Currently supports:
[go] [php] [python] [c] [swift] [csharp] [protobuf] [rust] [scala] [kotlin] [cpp] [dart] [java] [typescript]
None
-o string Optional Path to output file. .\[INPUT_FILE_DIR].[TARGET_LANGUAGE_EXTENSION]

Example

Windows

.\convjson.exe -o .\out\test.dart .\in\test.json dart

Linux

.\convjson -o .\out\test.dart .\in\test.json dart

And boom!

screenshot-2

(back to top)

Set Up Your Own

These are some instructions on setting up your project locally, just follow these simple steps.

Prerequisites

Installation

  1. Clone the repo.

    git clone https://github.com/ez4o/convert-json-cli.git
    cd convert-json-cli
  2. Install Go modules.

    go get -u

    Go module acts really different between versions, if you have any problem installing Go modules, please try:

    1. Upgrade Go version to 1.17.x
    2. go mod tidy -compat="1.17"
    3. go get -u

Generate Executable File

  1. Use release command, and it will generate a executable file in root directory.

    make release-windows

    or

    make release-linux

(back to top)

Roadmap

  • More Target Languages...

See the open issues for a full list of proposed features (and known issues).

(back to top)

Contributing

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feat/amazing-feature)
  3. Commit your Changes with Conventional Commits
  4. Push to the Branch (git push origin feat/amazing-feature)
  5. Open a Pull Request

(back to top)

License

Distributed under the MIT License. See LICENSE for more information.

(back to top)

Contact

Author

Project Link

(back to top)