Open aars opened 9 years ago
I believe this issue originates here: https://github.com/node-machine/machinepack-localmachinepacks/blob/master/machines/run-machine-interactive.js#L189
Where the typeSchema
is only used for parsing and validation. I'm not sure how to elegantly solve this. My first guess would be to set typeSchema
to '*'
when inputDef.validate
is defined and use that after rttc.parseHuman
.
Hey @aars, super late reply, sorry about that. For now, we've shifted away from working with the custom validate()
function in the tooling other than the machine runtime, since it can't be statically analyzed. I think the way to do this is probably to have the validate
function float on top of the exemplar. So you're right, in this case, you'd probably want to use a typeclass-style generic exemplar like *
, {}
, or ===
(keep in mind that, in the latter case, you'd be sending in a mutable reference).
I have to define
typeclass: '*'
, which apparently is not an issue when running throughtest-machinepack-mocha
.https://github.com/aars/machinepack-test-issue#machinepack-exec-oddity