Bazaarvoice Jolt Generic Spec for multiple Kinds of Input JSON -


i new jolt. have 2 different set of input json of same structure except 1 object inside differs based on decider value below.

eg: input json 1

{     "input": {         "decider": 1,         "object1": {             "object1info": 1                         "obj1specificobj2" : {                 obj2info : "data"             }         },         "doc": {             "docid": "doc100"         }     } } 

eg: input json 2

{     "input": {         "decider": 2,         "object2": {             "object2info": 2                         "obj2specificobj3" : {                 "obj3info1" : "data1",                 "obj3info2" : "data2",                                 "other" : {                                        "otherdata" : "data3"                                 }             }         },         "doc": {             "docid": "doc100"         }     } } 

output expectation if decider : 1

{     "out" : {         "object"" : {             "info"" : 1             "subobject" : {                 "subinfo" : "data"             }         },         "doc": {             "docid": "doc100"         }     } } 

output expectation if decider : 2

{     "out" : {         "object"" : {             "info"" : 1             "subobject" : {                 "subinfo1" : "data1",                 "subinfo2" : "data2",                                 "other" : {                                        "otherdata" : "data3"                                 }             }         },         "doc": {             "docid": "doc100"         }     } } 

i want write generic single conditional jolt spec based on "decider" value output should generated. there way write conditional statement inside spec file....??

see https://github.com/bazaarvoice/jolt/issues/231

same question ask there.


Comments

Popular posts from this blog

Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12:test (default-test) on project.Error occurred in starting fork -

windows - Debug iNetMgr.exe unhandle exception System.Management.Automation.CmdletInvocationException -

configurationsection - activeMq-5.13.3 setup configurations for wildfly 10.0.0 -