# `JsonSchema.Types.TypeReference`
[🔗](https://github.com/dragonwasrobot/json_schema/blob/0.6.0/lib/types/type_reference.ex#L1)

Represents a reference to a custom type definition in a JSON schema.

JSON Schema:

    "self": {
      "$ref": "#/definitions/foo"
    }

    "other": {
      "$ref": "http://www.example.com/definitions.json#bar"
    }

where "#/definitions/foo" resolves to

    "definitions": {
      "foo": {
        "type": "string"
      }
    }

and "http://www.example.com/definitions.json#bar" resolves to

    "definitions": {
      "bar": {
        "id": "#bar",
        "type": "number"
      }
    }

Resulting in the Elixir representation:

    %TypeReference{name: "self",
                   path: URI.parse("#/definitions/foo"]}

    %TypeReference{name: "other",
                   path: URI.parse("http://www.example.com/definitions.json#bar")}

# `t`

```elixir
@type t() :: %JsonSchema.Types.TypeReference{
  name: String.t() | :anonymous,
  path: JsonSchema.Types.typeIdentifier()
}
```

---

*Consult [api-reference.md](api-reference.md) for complete listing*
