Home

Awesome

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