Skip to content

Difference between Context and Facts #23

@fhirter

Description

@fhirter

From the README it do not fully understand the difference between "facts" and "context".

In the basic example "facts" seems to be the data on which the business rules are applied. The "context" can be used to parametrize rules.
Is this correct?

Why does it state below context that "It [context] can be used for interpolation or even as a source of facts".
In this chapter it seems that context is being evaluated agains the rules. But the context object

const context = {
  hotTemp: 20,
  city: 'Halifax',
  apiKey: 'XXXX',
  units: 'metric',
};

does not seem to match the rules:

    path: 'main.temp',
    is: {
      type: 'number',
      minimum: '{{hotTemp}}',
    },

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions