# `VerifiedPubSub.Transformers.ValidateFields`
[🔗](https://github.com/CuriousCurmudgeon/verified_pubsub/blob/v0.1.0/lib/verified_pubsub/transformers/validate_fields.ex#L1)

Validates the type of each declared field at compile time.

The Spark schema gives the type of a field the Spark type `:any`, because no Spark type
accepts a `{:list, type}` tuple or a struct module. Without this check,
`field :id, :strng` compiles with no error, and the field then matches no value at
runtime.

# `after_compile?`

# `before?`

# `primitives`

```elixir
@spec primitives() :: [atom()]
```

The primitive types that a manifest can give a field.

# `struct_module?`

```elixir
@spec struct_module?(atom()) :: boolean()
```

Whether `atom` names a module rather than a plain atom.

# `valid_type?`

```elixir
@spec valid_type?(term()) :: boolean()
```

Whether `type` is a valid field type.

The compiler may not have compiled a struct module yet when this check runs. So the
check finds a struct module by its `Elixir.` prefix, and does not load the module.

---

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