Refine multi-value vocab references#14
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThe PR replaces the ChangesReferences Container Implementation
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested labels
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
@coderabbitai review |
✅ Action performedReview finished.
|
Summary
OneOrMany<T>helper withReferences<T>for zero-or-more ActivityStreams fieldsReferences<T>as a scalar for one value and an array for multiple values#[serde(default, skip_serializing_if = "References::is_empty")]Context
This follows up on the issue #5 discussion about
Option<OneOrMany<T>>representing states JSON-LD does not distinguish. In JSON-LD, an absent property and an empty array are equivalent for multi-valued fields, so exposing bothNoneandSome(Many([]))would make callers handle a meaningless distinction.References<T>represents the semantic state directly:Reference<T>remains the singular ID-or-embedded-object helper.References<T>is for fields that can appear zero or more times.Validation
cargo fmt --checkcargo check -p feder-vocab --libcargo testmise run checkSummary by CodeRabbit
Release Notes
Breaking Changes
Tests