Skip to main content

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

Project description

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

jtd_codebuild-1.0.1.tar.gz (19.3 kB view details)

Uploaded Source

Built Distribution

jtd_codebuild-1.0.1-py3-none-any.whl (35.6 kB view details)

Uploaded Python 3

File details

Details for the file jtd_codebuild-1.0.1.tar.gz.

File metadata

  • Download URL: jtd_codebuild-1.0.1.tar.gz
  • Upload date:
  • Size: 19.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.2 CPython/3.11.9 Linux/6.5.0-1018-azure

File hashes

Hashes for jtd_codebuild-1.0.1.tar.gz
Algorithm Hash digest
SHA256 2728a94570cb410c62d93ab153903c9dff564e4c7f8e84aa902ef6e82075cdca
MD5 55e5b1bdd55b9829945747ef4b0f2f9d
BLAKE2b-256 c240132773180836f83d7012fbf941503dd15076a883b080af7fc5393209e8cf

See more details on using hashes here.

File details

Details for the file jtd_codebuild-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: jtd_codebuild-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 35.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.2 CPython/3.11.9 Linux/6.5.0-1018-azure

File hashes

Hashes for jtd_codebuild-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 6431b9449f6d67c3d127dcba680908c36b254b426395bf42bacf973288a91c2c
MD5 d2ff711e81249872656a40d9888ce1f5
BLAKE2b-256 af3c5206810c3e418a733f6caa084b07c2f56d0da18dec2fe7ae1995874b5ec3

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page