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
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:
- Python Codegen Examples
- TypeScript Codegen Examples
- Monorepo Example (includes other languages' examples)
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for jtd_codebuild-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9d66e8e6501d7fcc86f0760b74521f5ba78e98a84e6f76e7c727ed9aa7a47410 |
|
MD5 | a51e63bdb91dde63d4536ad0692def1a |
|
BLAKE2b-256 | 7117a2aa088ecceb6a2b0e11fba6c86593f9fd35770a7084a85595c419361b5c |