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

Defines `__verified_pubsub_fields__/2` on the manifest, with one clause for each event.

Each clause takes a topic and an event, and returns the fields that the manifest
declares for that event. A clause leaves out the `__spark_metadata__` of each field.
That metadata holds source annotations, which only add size to the compiled manifest.

## Tradeoffs

The manifest holds the fields, and each broadcast calls a clause to read them. This
gives up a little speed: a copy of the fields at each call site is a little faster. But
a module that Mix does not compile again after a change to the manifest keeps an old
copy. Each copy also makes its call site larger. A clause that returns a literal list
is fast enough to run on each broadcast.

# `after_compile?`

# `before?`

---

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