GithubHelp home page GithubHelp logo

jsontypeinference's Introduction

Json Type Inference

Project description

This project provides you with a way to automatically create data models of JSON files and functions to read into them.

What is and is not supported

Arbitrary nesting of objects is supported but only arrays that contain boolean, string or number values will work properly. If they don't a List<Any> type will be assumed. As many APIs send back an array of objects the usage I recommend is to only give the program the first element of the array and when using a deserialization library tell it that the JSON file has structure List<[Generated data class name]>. Another quirk is that if the JSON file provided is not an object then the data class generated will have a topLevel property with an appropriate type.

Usage

To use this project add an entry to the JSON array in src/main/resources/config.json with this structure:

{
    "source": "Path to a file with a sample JSON based on which data classes will be created",
    "dest": "Path to a file where the generated data classes will be placed",
    "className": "Name of the top level data class"
}

Run the program to update all files provided in config.json

jsontypeinference's People

Contributors

adam2809 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.