harmony-jolt 0.6.0

JSON to JSON transformation library using the JOLT spec
Documentation
{
    "input": {
        "string": "the QuIcK brOwn fox",
        "zeroIndex" : 0,
        "threeIndex" : 3,
        "trimMe" : "  tuna "
    },

    "spec": {
        "lower": {
            "leading":  "=toLower(@(2,string))",
            "trailing": "=toLower(^value)",
            "custom1":  "=toLower(bazinga)",
            "custom2":  "=toLower('yabadabadoo')",
            "badArgs1"  :  "=toLower(@2)"
        },
        "upper": {
            "leading": "=toUpper(@(2,string))",
            "trailing": "=toUpper(^value)",
            "custom1": "=toUpper(bazinga)",
            "custom2": "=toUpper('yabadabadoo')",
            "badArgs1"  : "=toLower(@2)"
        },
        "join": "=join('_' , @(1,lower.leading) ,  , @(1,lower.trailing))",
        "concat": {
            "basic": "=concat(@(2,lower.leading) , ' ' , @(2,lower.trailing))",
            "parens": "=concat(@(2,lower.leading) , ' (', @(2,lower.trailing), ')')"
        },
        "substring": {
            "basic1": "=substring(@(2,string), 0, 9)",
            "basic2": "=substring(@(2,string), 4, 9)",
            "outOfBounds1": "=substring(@(2,string), -4, 9)",  // start is negative
            "outOfBounds2": "=substring(@(2,string), 0, 200)", // end it way past the size of the string
            "outOfBounds3": "=substring(@(2,string), 0, 20)",  // verify that asking for one char after the end fails
            "badArgs1": "=substring(0, 9, @(2, substring))",  // input is not a string
            "badArgs2": "=substring(0, 4, 9)",      // ranges are ok, but input string is not a string
            "badArgs3": "=substring('', 0, 0)",
            "badArgs4": "=substring('abc', 0, 0)",  // start and end are the same, both are zero
            "badArgs5": "=substring('abc', 1, 1)",  // start and end are the same, and non-zero
            "badArgs6": "=substring('abc', 1, 0)",  // start before end
            "badArgs7": "=substring('abc', 0, 1, 2)", // too many args
            "badArgs8": "=substring('abc', 0)", // not enough args
            "custom1":  "=substring('the quick brown fox', 0, 15)",
            "custom2":  "=substring('the quick brown fox', 16, 19)",
            //
            // verify that we can actually lookup start and end indices
            "advancedLookupRanges" : "=substring(@(2,string), @(2,zeroIndex), @(2,threeIndex))"
        },
        "trim" :{
            "trimed" : "=trim(@(2,trimMe))"
        },
        "trimMe" : "=trim"
    },
    "context": {
        "value" : "JumpeD OVeR THE laZy dog"
    },

    "OVERWRITR": {
        //
        // the input
        "string" : "the QuIcK brOwn fox",
        "zeroIndex" : 0,
        "threeIndex" : 3,
        //
        // from the input, but overwritten by modify
        "trimMe" : "tuna",
        //
        // the things modify added
        "lower": {
            "leading": "the quick brown fox",
            "trailing": "jumped over the lazy dog",
            "custom1": "bazinga",
            "custom2": "yabadabadoo"
        },
        "upper": {
            "leading": "THE QUICK BROWN FOX",
            "trailing": "JUMPED OVER THE LAZY DOG",
            "custom1": "BAZINGA",
            "custom2": "YABADABADOO"
        },
        "join": "the quick brown fox_jumped over the lazy dog",
        "concat": {
            "basic": "the quick brown fox jumped over the lazy dog",
            "parens": "the quick brown fox (jumped over the lazy dog)"
        },
        "substring": {
            "basic1": "the QuIcK",
            "basic2": "QuIcK",
            "custom1": "the quick brown",
            "custom2": "fox",
            "advancedLookupRanges": "the"
        },
        "trim" :{
            "trimed" : "tuna"
        }
    }
}