Problem
Struct field lookup currently uses the liquid struct tag. Callers sometimes need to render types from other packages that already use tags such as json and cannot be modified.
Proposed direction
Make struct-tag lookup configurable on an Engine or render configuration instance, with liquid as the default. Do not expose a mutable package-global variable: separate engines can render concurrently with different policies, and a global setting would introduce races and cross-request behavior changes.
Possible APIs include setting an ordered list of tag keys (for example, liquid then json) or installing a field-name resolver. The design should specify how empty names, -, options such as omitempty, embedded fields, and duplicate names are handled.
Acceptance criteria
- Existing behavior remains the default.
- Configuration is scoped to an engine/render configuration.
- Two engines with different tag policies can render concurrently.
- Tests cover
liquid, json, ignored fields, embedded structs, and conflicts.
Problem
Struct field lookup currently uses the
liquidstruct tag. Callers sometimes need to render types from other packages that already use tags such asjsonand cannot be modified.Proposed direction
Make struct-tag lookup configurable on an
Engineor render configuration instance, withliquidas the default. Do not expose a mutable package-global variable: separate engines can render concurrently with different policies, and a global setting would introduce races and cross-request behavior changes.Possible APIs include setting an ordered list of tag keys (for example,
liquidthenjson) or installing a field-name resolver. The design should specify how empty names,-, options such asomitempty, embedded fields, and duplicate names are handled.Acceptance criteria
liquid,json, ignored fields, embedded structs, and conflicts.