Skip to content
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

Add RightSideComparisonResult as factResult #396

Merged
merged 6 commits into from
Nov 18, 2024

Conversation

thorin8k
Copy link
Contributor

@thorin8k thorin8k commented Nov 16, 2024

Hello!

I noticed the issue mentioned in #310, which is important for my use case, so I tried to address it with this pull request.

My implementation approach is straightforward. When setting the factResult for a condition, if the value property is an object, I include the rightSideValue as the factResult.

I'm eager to see this merged, as it is of great interest to me.

@chris-pardy
Copy link
Collaborator

Conceptually this is fine a few things

It should be in a field like valueResult not overriding the factResult

You should set the field unconditionally

Make sure you update the types and please add some more unit tests

@thorin8k
Copy link
Contributor Author

I've followed your advice and added the field unconditionally.

Also i've updated all acceptance tests to check for the new value and updated the typings.

I've also added an specific test for this feature checking if the valueResult matches.

@thorin8k
Copy link
Contributor Author

I've found that the toJSON Serialization was missing and added it. I've tested in a working application and now it correctly returns the value even when serializing to JSON.

@chris-pardy chris-pardy self-requested a review November 18, 2024 15:26
Copy link
Collaborator

@chris-pardy chris-pardy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@thorin8k Looks great, thanks for the contribution!

@chris-pardy chris-pardy merged commit 626604e into CacheControl:master Nov 18, 2024
3 checks passed
emilefokkemanavara added a commit to emilefokkemanavara/json-rules-engine that referenced this pull request Nov 18, 2024
chris-pardy added a commit that referenced this pull request Nov 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants