-
Notifications
You must be signed in to change notification settings - Fork 6
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
Choice rule payload validation path #253
Choice rule payload validation path #253
Conversation
expect(described_class.new("$$.foo").value({})).to be_nil | ||
expect { described_class.new("$$.foo").value({}, {"foo" => "bar"}) }.to raise_error(Floe::PathError, "Path [$$.foo] references an invalid value") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is the essence of the issue
580ca92
to
dceeab9
Compare
update:
|
Before: If the path referenced a missing value in the input, treat it as a nil. After: If the path references a missing value in the input, raise an error. This makes it necessary to catch errors and ensure that the context is marked appropriately. Since a path lookup is so stringent, introduce the presence_check.
dceeab9
to
22c08f9
Compare
Checked commits kbrock/floe@29f923a~...22c08f9 with ruby 3.1.5, rubocop 1.56.3, haml-lint 0.51.0, and yamllint |
update:
|
WIP: moving stuff around. Want to get other stuff merged before this. |
WIP: oops. thought this was something else. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 LGTM
extracted from #189
Before
If the path referenced a missing value in the input, treat it as a nil.
After
If the path references a missing value in the input, raise an error.
presence_check
method to check if it is present up front.IsPresent: false
andIsPresent: true