ManageIQ / floe

Floe is a runner for Amazon States Language workflows
Apache License 2.0
0 stars 6 forks source link

allow non quoted json keys for input #148

Closed kbrock closed 11 months ago

kbrock commented 11 months ago

Before

bundle exec exe/floe --input='{"foo": 2}' examples/run-json.asl

After

bundle exec exe/floe --input='{foo: 2}' examples/run-json.asl
agrare commented 11 months ago

@kbrock isn't {foo: 2} invalid json?

miq-bot commented 11 months ago

Checked commit https://github.com/kbrock/floe/commit/1e450f75e850f084858182a5f557ab890682cf1d with ruby 2.7.8, rubocop 1.56.3, haml-lint 0.51.0, and yamllint 0 files checked, 0 offenses detected Everything looks fine. :+1:

kbrock commented 11 months ago

@kbrock isn't {foo: 2} invalid json?

Yes. It is invalid.

This PR takes the simplified text from the command line and adds quotes around it to turn it into something valid.

It is tricky to type this out since you need to wrap everything in double quotes and the individual keys in single quotes (or vice versa). Removing one level of quotes is a boon.

Fryguy commented 11 months ago

I'm not sure about this, because it makes it appear like invalid json is acceptable.

kbrock commented 11 months ago

punting on this idea