jtool

package module
v0.0.0-...-f1d1b13 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 4, 2020 License: MIT Imports: 0 Imported by: 0

README

Introduction

This project implemented a set of tools to create, manipulate and validate JSONs. It was created when I was developing a project (closed source, inspired by Blueprints of UnrealEngine) which uses configuration files to define RESTful APIs. The project splited API handling to multiple stages (e.g., processing request stage, MySQL/MongoDB interact stage, Redis interact stage, 3rd-party API call stage, response stage, etc), all these stages share one JSON pool, and each stage can create the needed JSON as input from the JSON pool (by using template and operator), also, each stage can add its product JSON to the JSON pool for other stages to use.

Example

Given JSON 'foo':

{
    "a1": 1
}

Given JSON 'bar':

{
    "b1": "hello world"
}

Given JSON template:

{
    "f1": "*foo/a1",
    "f2": "*bar/b1"
}

After executing the template, we can get the following JSON:

{
    "f1": 1,
    "f2": "hello world"
}

Please read template doc for more details.

Playground

  1. template
  2. template & operator
  3. template with 2D array

Documentation

Overview

Package jtool implemented a set of tools for JSON.

Schema: Validate JSON.

Template: Create JSON from JSON pool.

Operator: Manipulate JSON by operators.

Directories

Path Synopsis
Package template generates json from multi jsons (json pool).
Package template generates json from multi jsons (json pool).

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL