osteele / osteele/liquid

Allow configuring struct tag keys per engine

Open
#60 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.