Private beta, by invitation. It may change without warning. While the beta lasts, some paid features are free. See pricing

trumlyspec GitHub
Try trumly

Conformance cases /

forward-compat

Tests one part of the structure checks.

Our implementation passes this case when its check --json output for the input below equals the expected output.

Input

nodes/a.md
---
id: a
type: future-kind
title: A
future_key: ignored
future_map:
  x: 1
fields:
  owner: x
  future_field:
    nested: [1, 2]
links:
  - type: future-link
    to: b
    future_link_key: ignored
---
Body.
nodes/b.md
---
id: b
type: future-kind
fields:
  owner: y
---
nodes/c.md
---
id: c
type: future-kind
---
nodes/r.md
---
id: r
type: rule
fields:
  statement: s
  severity: error
  applies_to: {type: future-kind}
  check: {require_fields: [owner]}
---

Expected output

0 ghosts · 0 load errors · 4 nodes · 3 results

expected.json
{
 "ghosts": [],
 "load_errors": [],
 "nodes": [
  {
   "body": "Body.",
   "fields": {
    "future_field": {
     "nested": [
      1,
      2
     ]
    },
    "owner": "x"
   },
   "id": "a",
   "links": [
    {
     "to": "b",
     "type": "future-link"
    }
   ],
   "parent": null,
   "plane": null,
   "title": "A",
   "type": "future-kind"
  },
  {
   "body": "",
   "fields": {
    "owner": "y"
   },
   "id": "b",
   "links": [],
   "parent": null,
   "plane": null,
   "title": "b",
   "type": "future-kind"
  },
  {
   "body": "",
   "fields": {},
   "id": "c",
   "links": [],
   "parent": null,
   "plane": null,
   "title": "c",
   "type": "future-kind"
  },
  {
   "body": "",
   "fields": {
    "applies_to": {
     "type": "future-kind"
    },
    "check": {
     "require_fields": [
      "owner"
     ]
    },
    "severity": "error",
    "statement": "s"
   },
   "id": "r",
   "links": [],
   "parent": null,
   "plane": null,
   "title": "r",
   "type": "rule"
  }
 ],
 "results": [
  {
   "node": "a",
   "rule": "r",
   "severity": "error",
   "status": "pass"
  },
  {
   "node": "b",
   "rule": "r",
   "severity": "error",
   "status": "pass"
  },
  {
   "node": "c",
   "rule": "r",
   "severity": "error",
   "status": "fail"
  }
 ],
 "structure": {
  "errors": [],
  "warnings": []
 }
}