guardian / typerighter

Even if you’re the right typer, couldn’t hurt to use Typerighter!
Apache License 2.0
276 stars 12 forks source link

Check a rule from the rule manager #389

Closed jonathonherbert closed 1 year ago

jonathonherbert commented 1 year ago

What does this change?

Adds an endpoint to check a rule manager rule from the rule manager against the specified copy.

The route is /api/rules/:id/test-block, and the document is specified in the body – here's an example:

{
  "id": "id",
  "blocks": [
    {
      "id": "elem-0",
      "text": "The chancellor, [Jeremy Hunt](https://www.theguardian.com/politics/jeremy-hunt), said the best way to get growth going again was to ease pressure on households by bringing down inflation. “While an extra bank holiday had an impact on growth in May, high inflation remains a drag anchor on economic growth,” he said.",
      "from": 0,
      "to": 413
    }
  ]
}

Dev notes

How to test