Giter Site home page Giter Site logo

01joseph-hwang10 / jtd-codebuild Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 2.0 205 KB

Tool for generating language specific schemas and interfaces code from JSON Type Definition IDL files in yaml format. Powered by jtd-codegen.

Home Page: https://pypi.org/project/jtd-codebuild/

License: MIT License

Python 97.21% HCL 2.79%
code-generation json-type-definition json

jtd-codebuild's Introduction

JSON Type Definition Code Build

PyPI version Testsuite Python version Project Status Supported Interpreters License

jtd-codebuild is a tool for generating language specific schemas and interfaces code from JSON Type Definition IDL files in either yaml or json format.

This tool is built on top of jtd-codegen so check out the documentation if you don't have a clue about JSON Type Definition.

Quick Example

In this example, we will generate Python and TypeScript code from JSON Type Definition IDL files.

First, copy and paste the following configuration file to the root of your project.

{
  "include": [
    "src"
  ],
  "references": [],
  "jtdBundlePath": "gen/schema.jtd.json",
  "targets": [
    {
      "language": "python",
      "path": "gen/python"
    },
    {
      "language": "typescript",
      "path": "gen/typescript"
    }
  ],
  "$schema": "https://raw.githubusercontent.com/01Joseph-Hwang10/jtd-codebuild/master/jtd_codebuild/config/project/config.json"
}

Then, we'll create some JSON Type Definition IDL files in the src directory.

# src/book.jtd.yaml
Book:
  properties:
    id:
      type: string
    title:
      type: string
# src/user.jtd.yaml
User:
  properties:
    id:
      type: string
    name:
      type: string
    books:
      elements:
        ref: Book

Finally, run the following command to generate the code.

jtd-codebuild .

You can find the generated code in the gen directory.

More Examples

You can find more examples under the tests directory:

API Documentation

See the API Documentation for more information.

Contributing

Any contribution is welcome! Check out CONTRIBUTING.md and CODE_OF_CONDUCT.md for more information on how to get started.

License

jtd-codebuild is licensed under a MIT License.

jtd-codebuild's People

Contributors

01joseph-hwang10 avatar zcarroll4 avatar pixeebot[bot] avatar pixeebot avatar

Watchers

 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.