---
source: crates/aiken-project/src/blueprint/validator.rs
description: "Code:\n\npub type LinkedList<a> {\n  Cons(a, LinkedList<a>)\n  Nil\n}\n\npub type Foo {\n    Foo {\n        foo: LinkedList<Bool>,\n    }\n    Bar {\n        bar: Int,\n        baz: (ByteArray, List<LinkedList<Int>>)\n    }\n}\n\nvalidator recursive_generic_types {\n  spend(datum: Option<Foo>, redeemer: LinkedList<Int>, output_reference: Data, transaction: Data) {\n    True\n  }\n}\n"
---
{
  "title": "test_module.recursive_generic_types.spend",
  "datum": {
    "title": "datum",
    "schema": {
      "$ref": "#/definitions/test_module~1Foo"
    }
  },
  "redeemer": {
    "title": "redeemer",
    "schema": {
      "$ref": "#/definitions/test_module~1LinkedList$Int"
    }
  },
  "compiledCode": "<redacted>",
  "hash": "<redacted>",
  "definitions": {
    "Bool": {
      "title": "Bool",
      "anyOf": [
        {
          "title": "False",
          "dataType": "constructor",
          "index": 0,
          "fields": []
        },
        {
          "title": "True",
          "dataType": "constructor",
          "index": 1,
          "fields": []
        }
      ]
    },
    "ByteArray": {
      "dataType": "bytes"
    },
    "Int": {
      "dataType": "integer"
    },
    "List$test_module/LinkedList$Int": {
      "dataType": "list",
      "items": {
        "$ref": "#/definitions/test_module~1LinkedList$Int"
      }
    },
    "Tuple$ByteArray_List$test_module/LinkedList$Int": {
      "title": "Tuple",
      "dataType": "list",
      "items": [
        {
          "$ref": "#/definitions/ByteArray"
        },
        {
          "$ref": "#/definitions/List$test_module~1LinkedList$Int"
        }
      ]
    },
    "test_module/Foo": {
      "title": "Foo",
      "anyOf": [
        {
          "title": "Foo",
          "dataType": "constructor",
          "index": 0,
          "fields": [
            {
              "title": "foo",
              "$ref": "#/definitions/test_module~1LinkedList$Bool"
            }
          ]
        },
        {
          "title": "Bar",
          "dataType": "constructor",
          "index": 1,
          "fields": [
            {
              "title": "bar",
              "$ref": "#/definitions/Int"
            },
            {
              "title": "baz",
              "$ref": "#/definitions/Tuple$ByteArray_List$test_module~1LinkedList$Int"
            }
          ]
        }
      ]
    },
    "test_module/LinkedList$Bool": {
      "title": "LinkedList",
      "anyOf": [
        {
          "title": "Cons",
          "dataType": "constructor",
          "index": 0,
          "fields": [
            {
              "$ref": "#/definitions/Bool"
            },
            {
              "$ref": "#/definitions/test_module~1LinkedList$Bool"
            }
          ]
        },
        {
          "title": "Nil",
          "dataType": "constructor",
          "index": 1,
          "fields": []
        }
      ]
    },
    "test_module/LinkedList$Int": {
      "title": "LinkedList",
      "anyOf": [
        {
          "title": "Cons",
          "dataType": "constructor",
          "index": 0,
          "fields": [
            {
              "$ref": "#/definitions/Int"
            },
            {
              "$ref": "#/definitions/test_module~1LinkedList$Int"
            }
          ]
        },
        {
          "title": "Nil",
          "dataType": "constructor",
          "index": 1,
          "fields": []
        }
      ]
    }
  }
}
