Skip to content

Commit 1a23639

Browse files
committed
fix empty manifest links serialization
1 parent c062c58 commit 1a23639

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file.
44

55
**Warning:** Features marked as *alpha* may change or be removed in a future release without notice. Use with caution.
66

7+
## [0.12.1] - 2025-10-14
8+
9+
### Fixed
10+
11+
- If the `links` array in a manifest is empty, it was set to `null` when the manifest was serialized to JSON. Now, it is not included, which is the proper behavior
12+
713
## [0.12.0] - 2025-10-14
814

915
All services are now hidden by default. This mainly affects implementers creating webservers, but you also shouldn't need to manually remove services just to produce clean manifest output. To restore previous functionality, set the `streamer.Config`'s `AddServiceLinks` to `true`

pkg/manifest/manifest.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -384,12 +384,10 @@ func (m Manifest) ToMap(selfLink *Link) map[string]interface{} {
384384
res["metadata"] = m.Metadata
385385
if selfLink != nil {
386386
newList := make(LinkList, len(m.Links)+1)
387-
for i, link := range m.Links {
388-
newList[i] = link
389-
}
387+
copy(newList, m.Links)
390388
newList[len(newList)-1] = *selfLink
391389
res["links"] = newList
392-
} else {
390+
} else if len(m.Links) > 0 {
393391
res["links"] = m.Links
394392
}
395393
res["readingOrder"] = m.ReadingOrder

0 commit comments

Comments
 (0)