-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow sending other valid JSON types as IIPs #10
Comments
Ideally we could go as far as parsing json inputs that can then be fed to the ports of the graph. |
When passing '\n' or other escaped characters they are treated as literals , this can be observed when using file writing components. '1' NUMBER -> IN SomeNode |
All of the previous are JavaScript expressions, couldn't just inject them directly into NoFlo using an eval() or something? |
That can lead to abuse and bugs. But yes, JSON deserializing is what has to be done, with JSON.parse or some other safe method, eval() could mess with noflo. Although i'm not really happy in retrospective with the OBJECT type for IIPs, since it could be abused into messy graph definitions, but for testing it would be really nice. |
There are easy ways to work around not using eval(). el = JSON.parse("{ value: " + stringFromFbpFile + "}"); And then pass the el.value to the processes' ports. How do you describe complex stuff like : [true, [0, 1, 2, 3], "Plop"] |
Wouldn't that be a smell? Configuring processes with contrived data structures doesn't seem smart to me at least. |
Heads up I've implemented this (basically just pulled in peg.js' JSON grammar) in #58. |
Currently the FBP parser only allows strings to be defined as IIPs, but other types are also necessary.
Examples:
The text was updated successfully, but these errors were encountered: