Builds a serializer for a plain object or view model. A serializer is a function
that takes the data to render and declares the keys to render it with:
A serializer must not read its data while being built: what it declares may not
depend on its data. Dream and Psychic build it without data to read its shape (the
OpenAPI schema, and the null and other-variant keys of a flattened association or
customAttribute that uses it), so a serializer that reads its data while being
built throws when a flattened association or customAttribute that uses it is
rendered. Read the data inside a customAttribute callback, which runs only when
the serializer renders, not while it is built.
Builds a serializer for a plain object or view model. A serializer is a function that takes the data to render and declares the keys to render it with:
A serializer must not read its data while being built: what it declares may not depend on its data. Dream and Psychic build it without data to read its shape (the OpenAPI schema, and the null and other-variant keys of a flattened association or
customAttributethat uses it), so a serializer that reads its data while being built throws when a flattened association orcustomAttributethat uses it is rendered. Read the data inside acustomAttributecallback, which runs only when the serializer renders, not while it is built.