Skip to content

fix(ead): stop xml.Name fields shadowing child elements in json - #215

Merged
kiivihal merged 1 commit into
mainfrom
fix/ead-json-tags
Oct 30, 2026
Merged

kiivihal merged 1 commit into
mainfrom
fix/ead-json-tags

Conversation

@kiivihal

@kiivihal kiivihal commented Oct 30, 2026 •

Copy link
Copy Markdown
Member

Clears the last go vet warnings ("struct field … repeats json tag"). After this, go vet ./... is clean.

  • 18 XMLName fields in hub3/ead/parser_structs.go, hub3/ead/mets.go and ikuzo/rdf/schema/recdef/recdef.go shared their json name with the child element of the same name. encoding/json dropped both fields, so nested elements like accessrestrict, div and elem were missing from JSON output. XMLName is now json:"-".
  • Dsc.Numbered (c01) shared "c" with Dsc.Cc and now uses "c01".

Behaviour change: JSON output of these parser structs now includes the previously dropped child elements and omits the XMLName object. No code in the repo marshals these structs to JSON (the EAD cache and search requests use their own types). EAD support will be refactored anyway.

go test ./... passes locally, Docker suites included.

🤖 Generated with Claude Code

XMLName shared its json tag with the child element of the same name,
so encoding/json dropped both. Tag XMLName json:"-" and give
Dsc.Numbered its own c01 tag.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@codecov

codecov Bot commented Oct 30, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 36.01%. Comparing base (882403b) to head (79274f3).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #215   +/-   ##
=======================================
  Coverage   36.01%   36.01%           
=======================================
  Files         412      412           
  Lines       38115    38115           
=======================================
  Hits        13726    13726           
  Misses      24387    24387           
  Partials        2        2           
Flag Coverage Δ
unittests 36.01% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@kiivihal
kiivihal merged commit 3fcc554 into main Oct 30, 2026
6 checks passed
@kiivihal
kiivihal deleted the fix/ead-json-tags branch October 30, 2026 07:06
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