Skip to content
This project implemented JSON template, JSON schema & JSON operator. With these tools, you can move data processing from codes to configuration files.
Go
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
ejp
jutil
jvalue
operator
schema
template
LICENSE
README.md
doc.go

README.md

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
You can’t perform that action at this time.