---
source: crates/aiken-project/src/blueprint/validator.rs
description: "Code:\n\npub type Either<left, right> {\n    Left(left)\n    Right(right)\n}\n\npub type Interval<a> {\n    Finite(a)\n    Infinite\n}\n\nvalidator generics {\n  spend(datum: Option<Data>, redeemer: Either<ByteArray, Interval<Int>>, output_reference: Data, transaction: Data) {\n    True\n  }\n}\n"
---
{
  "title": "test_module.generics.spend",
  "datum": {
    "title": "datum",
    "schema": {
      "$ref": "#/definitions/Data"
    }
  },
  "redeemer": {
    "title": "redeemer",
    "schema": {
      "$ref": "#/definitions/test_module~1Either$ByteArray_test_module~1Interval$Int"
    }
  },
  "compiledCode": "<redacted>",
  "hash": "<redacted>",
  "definitions": {
    "ByteArray": {
      "dataType": "bytes"
    },
    "Data": {
      "title": "Data",
      "description": "Any Plutus data."
    },
    "Int": {
      "dataType": "integer"
    },
    "test_module/Either$ByteArray_test_module/Interval$Int": {
      "title": "Either",
      "anyOf": [
        {
          "title": "Left",
          "dataType": "constructor",
          "index": 0,
          "fields": [
            {
              "$ref": "#/definitions/ByteArray"
            }
          ]
        },
        {
          "title": "Right",
          "dataType": "constructor",
          "index": 1,
          "fields": [
            {
              "$ref": "#/definitions/test_module~1Interval$Int"
            }
          ]
        }
      ]
    },
    "test_module/Interval$Int": {
      "title": "Interval",
      "anyOf": [
        {
          "title": "Finite",
          "dataType": "constructor",
          "index": 0,
          "fields": [
            {
              "$ref": "#/definitions/Int"
            }
          ]
        },
        {
          "title": "Infinite",
          "dataType": "constructor",
          "index": 1,
          "fields": []
        }
      ]
    }
  }
}
