Repository navigation
fix(ead): stop xml.Name fields shadowing child elements in json - #215
Merged
Merged
Conversation
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 Report✅ All modified and coverable lines are covered by tests. 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
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Clears the last
go vetwarnings ("struct field … repeats json tag"). After this,go vet ./...is clean.XMLNamefields inhub3/ead/parser_structs.go,hub3/ead/mets.goandikuzo/rdf/schema/recdef/recdef.goshared their json name with the child element of the same name.encoding/jsondropped both fields, so nested elements likeaccessrestrict,divandelemwere missing from JSON output.XMLNameis nowjson:"-".Dsc.Numbered(c01) shared"c"withDsc.Ccand now uses"c01".Behaviour change: JSON output of these parser structs now includes the previously dropped child elements and omits the
XMLNameobject. 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