{
  "schema": "https://bars.commonsware.com/conformance/schema/render-fixture.schema.json",
  "version": "0.1.0",
  "cases": [
    {
      "name": "map-simple-key",
      "spotlight": true,
      "description": "A bare property name is resolved as a KPointer dot-notation segment and 'just works'.",
      "template": "{{ items | map: \"name\" }}",
      "context": {
        "items": [
          {
            "name": "a"
          },
          {
            "name": "b"
          }
        ]
      },
      "expect": {
        "kind": "output",
        "expectedOutput": "[\"a\",\"b\"]"
      }
    },
    {
      "name": "map-nested-rfc6901-pointer",
      "spotlight": true,
      "description": "A leading-slash argument is resolved as a strict RFC 6901 JSON Pointer for nested access.",
      "template": "{{ items | map: \"/addr/city\" }}",
      "context": {
        "items": [
          {
            "addr": {
              "city": "NYC"
            }
          },
          {
            "addr": {
              "city": "LA"
            }
          }
        ]
      },
      "expect": {
        "kind": "output",
        "expectedOutput": "[\"NYC\",\"LA\"]"
      }
    },
    {
      "name": "map-nested-dot-notation",
      "description": "A dotted argument is resolved as nested dot-notation for nested access.",
      "template": "{{ items | map: \"addr.city\" }}",
      "context": {
        "items": [
          {
            "addr": {
              "city": "NYC"
            }
          },
          {
            "addr": {
              "city": "LA"
            }
          }
        ]
      },
      "expect": {
        "kind": "output",
        "expectedOutput": "[\"NYC\",\"LA\"]"
      }
    },
    {
      "name": "map-missing-property-is-null-element",
      "description": "A struct missing the property contributes a null element to the result list.",
      "template": "{{ items | map: \"name\" }}",
      "context": {
        "items": [
          {
            "name": "a"
          },
          {
            "x": 1
          }
        ]
      },
      "expect": {
        "kind": "output",
        "expectedOutput": "[\"a\",null]"
      }
    },
    {
      "name": "map-non-list-is-null",
      "description": "map operates only on lists; a string input yields null.",
      "template": "{{ x | map: \"name\" }}",
      "context": {
        "x": "hi"
      },
      "expect": {
        "kind": "output",
        "expectedOutput": "null"
      }
    },
    {
      "name": "map-non-struct-contents-is-null",
      "description": "map expects a list of structs; non-struct contents yield null for the whole result.",
      "template": "{{ xs | map: \"name\" }}",
      "context": {
        "xs": [
          1,
          2,
          3
        ]
      },
      "expect": {
        "kind": "output",
        "expectedOutput": "null"
      }
    },
    {
      "name": "map-zero-args-is-error",
      "description": "Zero arguments is an arity error.",
      "template": "{{ items | map }}",
      "context": {
        "items": [
          {
            "name": "a"
          }
        ]
      },
      "expect": {
        "kind": "error",
        "errorCode": "KB-2002"
      }
    }
  ]
}
