Closed SimonVillage closed 2 years ago
Hi @SimonHausdorf thanks for reporting the issue. It's related to the https://github.com/moleculerjs/moleculer-repl/issues/47
The issue is caused by vorpal, a dependency lib that we're using, and unfortunately it's no longer maintained. We are aware of vorpal's limitations and we're (slowly :sweat_smile:) migrating to another lib https://github.com/moleculerjs/moleculer-repl/issues/48
Still, I'll try to explain the issue: In the first example the params are being parsed by vorpal, so the handler (moleculer-repl logic) already receives strings as numbers
Here are the args passed to the handler:
// call greeter.hello --phone "+1111111" --passcode "0033"
{
options: { phone: 1111111, passcode: 33 },
actionName: 'greeter.hello',
rawCommand: 'call greeter.hello --phone "+1111111" --passcode "0033"'
}
In the second example the args look like this:
// call greeter.hello '{"phone": "+ 1111111", "passcode": "0033"}'
{
options: {},
actionName: 'greeter.hello',
jsonParams: '{"phone": "+ 1111111", "passcode": "0033"}',
rawCommand: `call greeter.hello '{"phone": "+ 1111111", "passcode": "0033"}'`
}
and, in this case, the parsing is handled on our side https://github.com/moleculerjs/moleculer-repl/blob/04b15a43c1321f176d74962ffb4042ebbc3fe715/src/commands/call.js#L18
however, when passing as json it works.