Allow configuring struct tag keys per engine
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 354
- Forks
- 72
- PR merge metrics
- No merged PRs in 30d
Description
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.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the Engine or render configuration entry point and the existing struct-tag lookup. Review how empty names, '-', options, embedded fields, and duplicate names should behave, then add tests for liquid, json, ignored fields, embedded structs, conflicts, and concurrent engines. Done means the default is unchanged and separate engines can use different policies safely.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- backend
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100