Skip to content

Fix config path lookup for fields with omitempty json tags#2

Open
phyceClaw wants to merge 1 commit into
phyce:mainfrom
phyceClaw:fix/config-patch-omitempty
Open

Fix config path lookup for fields with omitempty json tags#2
phyceClaw wants to merge 1 commit into
phyce:mainfrom
phyceClaw:fix/config-patch-omitempty

Conversation

@phyceClaw

Copy link
Copy Markdown

Summary

findFieldByJSONTag compared the full struct tag (e.g. server,omitempty) instead of the name before the comma, so any config field tagged json:"x,omitempty" could not be resolved by SetValueToPath/GetValueFromPath. This silently broke config updates for fields like server and audioCache.

  • Split the tag on , and match only the name (mirrors the existing logic in schema.go).
  • Fixed a malformed json:"engines, omitempty" tag (stray space disabled omitempty).

Testing

CGO_ENABLED=1 go build ./... passes; go vet clean.

🤖 Generated with Claude Code

findFieldByJSONTag compared the full struct tag instead of the name
before the comma, so fields tagged json:"x,omitempty" (server,
audioCache, ...) could never be resolved by SetValueToPath/
GetValueFromPath, silently breaking config PATCH for those fields.
Also fix a malformed json:"engines, omitempty" tag (stray space).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant