{ "name": "fizz-buzz HTTP Example", "version": "0.0.1", "envs": [], "businessOperations": [ { "identifier": "isDivisibleBy", "input": { "number": { "type": "number", "required": true }, "divisor": { "type": "number", "required": true } }, "output": { "boolean": { "type": "boolean", "required": true } }, "constants": [ { "type": "boolean", "value": true, "name": "true" }, { "type": "boolean", "value": true, "name": "false" }, { "type": "number", "value": 0, "name": "zero" } ], "variables": [], "configuration": [ { "key": 1, "dependencies": [ { "origin": "input", "originPath": "number", "targetPath": "A" }, { "origin": "input", "originPath": "divisor", "targetPath": "B" } ], "moduleName": "modulus", "moduleType": "internal" }, { "key": 2, "dependencies": [ { "origin": 1, "originPath": "result.result", "targetPath": "A" }, { "origin": "constant", "originPath": "zero", "targetPath": "B" } ], "moduleName": "equalTo", "moduleType": "internal" }, { "key": 0, "dependencies": [ { "origin": 2, "originPath": "result.isEqual", "targetPath": "boolean" } ], "moduleName": "output", "moduleType": "output" } ] }, { "identifier": "fizzBuzz", "input": { "number": { "type": "number", "required": true } }, "output": { "text": { "type": "string", "required": true } }, "constants": [ { "type": "string", "value": "Fizz!", "name": "fizz" }, { "type": "string", "value": "Buzz!", "name": "buzz" }, { "type": "string", "value": "FizzBuzz!", "name": "fizzBuzz" }, { "type": "number", "value": 3, "name": "fizzDivisor" }, { "type": "number", "value": 5, "name": "buzzDivisor" } ], "variables": [], "configuration": [ { "key": 2, "moduleName": "isDivisibleBy", "moduleType": "bop", "dependencies": [ { "origin": "input", "originPath": "number", "targetPath": "number" }, { "origin": "constants", "originPath": "fizzDivisor", "targetPath": "divisor" } ] }, { "key": 3, "moduleName": "isDivisibleBy", "moduleType": "bop", "dependencies": [ { "origin": "input", "originPath": "number", "targetPath": "number" }, { "origin": "constants", "originPath": "buzzDivisor", "targetPath": "divisor" } ] }, { "key": 4, "moduleName": "and", "moduleType": "internal", "dependencies": [ { "origin": 2, "originPath": "result.boolean", "targetPath": "A" }, { "origin": 3, "originPath": "result.boolean", "targetPath": "B" } ] }, { "key": 6, "moduleName": "if", "moduleType": "internal", "dependencies": [ { "origin": 3, "originPath": "result.boolean", "targetPath": "boolean" }, { "origin": "constant", "originPath": "buzz", "targetPath": "ifTrue" }, { "origin": "input", "originPath": "number", "targetPath": "ifFalse" } ] }, { "key": 5, "moduleName": "if", "moduleType": "internal", "dependencies": [ { "origin": 2, "originPath": "result.boolean", "targetPath": "boolean" }, { "origin": "constant", "originPath": "fizz", "targetPath": "ifTrue" }, { "origin": 6, "originPath": "result.outputValue", "targetPath": "ifFalse" } ] }, { "key": 1, "moduleName": "if", "moduleType": "internal", "dependencies": [ { "origin": 4, "originPath": "result.bothTrue", "targetPath": "boolean" }, { "origin": "constant", "originPath": "fizzBuzz", "targetPath": "ifTrue" }, { "origin": 5, "originPath": "result.outputValue", "targetPath": "ifFalse" } ] }, { "key": 0, "dependencies": [ { "origin": 1, "originPath": "result.outputValue", "targetPath": "text" } ], "moduleName": "output", "moduleType": "output" } ] } ], "schemas": [], "addons": [ { "identifier": "http", "version": "4.0.0-rc5", "source": "http-meta-protocol", "collectStrategy": "npm", "configuration": { "port": 8080, "host": "0.0.0.0", "routes": [ { "route": "/number/:value", "businessOperation": "fizzBuzz", "method": "GET", "inputMapConfiguration": [ { "origin": "route", "originPath": "value", "targetPath": "number" } ], "resultMapConfiguration": { "statusCode": 200, "headers": [], "body": { "result": "text" } } } ] } } ] }