Skip to content

RuleResult does not serialize  #172

Closed
@silesky

Description

@silesky

Related to: #47

I get the following response when attempting to to serialize a RuleResult (i.e. using express's res.json(ruleResult) method).

"{\"conditions\":{\"priority\":1,\"all\":[{\"priority\":1,\"any\":[{\"priority\":1,\"any\":[{\"operator\":\"in\",\"value\":[\"foo\",\"bar\",\"baz\"],\"fact\":\"productType\",\"factResult\":\"baz\",\"result\":true}...

As a workaround, I've done JSON.parse(JSON.stringify(ruleResult));

can we either:

  • have them serialize properly
  • add a .toJSON() method?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions