Compile-time JSON codec injected into every generated schema via the
generator's schema_use option.
oapi_generator emits each schema's struct and its __fields__/1 type
metadata, but no code that moves data on or off the wire. This macro fills
both directions at compile time, so each schema carries its own conversion:
- encode -- a
Jason.Encoderimplementation that omits unset (nil) and internal (:__info__) fields, because Firecracker rejects some explicit nulls and absent optionals must simply not be sent. - decode -- a
decode/1specialized from the schema's__fields__/1(read via@before_compile, since the function can't be called during its own module's compilation). Field casts are baked in: nested schemas and lists dispatch to their own generateddecode/1, everything else passes through. No runtime type reflection.