# `JSONAPIPlug.Resource.Meta`
[🔗](https://github.com/lucacorti/jsonapi_plug/blob/main/lib/jsonapi_plug/resource/meta.ex#L1)

Resource Links

Implement this protocol to generate JSON:API metadata for indivudual resources.
Metadata returned will be included for each resource `meta` in JSON:API responses.

This example implementation generates metadata for each `MyApp.Post` resource.

```elixir
  defimpl JSONAPIPlug.Resource.Meta, for: MyApp.Post do
    def meta(%@for{} = post, _conn), do: %{slug: to_slug(post.title)}

    defp to_slug(string), do: string  |> String.downcase |> String.replace(" ", "-")
  end
```

# `t`

```elixir
@type t() :: term()
```

All the types that implement this protocol.

# `meta`

```elixir
@spec meta(JSONAPIPlug.Resource.t(), Plug.Conn.t()) ::
  JSONAPIPlug.Document.meta() | nil
```

Resource meta

Returns the resource meta to be returned for resources by the resource.

---

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