Add optional extraMetadata map to FieldSpec#18984
Draft
navina wants to merge 1 commit into
Draft
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #18984 +/- ##
============================================
+ Coverage 65.05% 65.23% +0.17%
- Complexity 1403 1405 +2
============================================
Files 3399 3418 +19
Lines 212808 214651 +1843
Branches 33568 33922 +354
============================================
+ Hits 138443 140018 +1575
- Misses 63223 63335 +112
- Partials 11142 11298 +156
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:
|
502c142 to
4d10b2f
Compare
Add an optional, additive Map<String, String> extraMetadata to FieldSpec for free-form per-column metadata: @JsonInclude(NON_EMPTY) so it is omitted when unset/empty, excluded from isBackwardCompatibleWith, and round-tripped via the shared appendFieldIdAndAliases helper (so TimeFieldSpec preserves it too). The keys and their interpretation are defined by whoever populates it; the core schema attaches no semantics. Rolling-upgrade safe: old readers ignore the unknown property (concrete subclasses are @JsonIgnoreProperties(ignoreUnknown)), new writers omit it when empty.
4d10b2f to
6c2b0c7
Compare
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.
Summary
Adds an optional, additive
Map<String, String> extraMetadatatoFieldSpecfor free-formper-column metadata.
Details
@JsonInclude(NON_EMPTY)— omitted from serialization when unset/empty.isBackwardCompatibleWith(purely additive, never affects compatibility).appendFieldIdAndAliaseshelper, soTimeFieldSpecpreserves it as well.
nullin the setter, keeping equality/serialization stable.attaches no semantics to it.
Compatibility
Rolling-upgrade safe: old readers ignore the unknown property (concrete subclasses are
@JsonIgnoreProperties(ignoreUnknown = true)), and new writers omit it when empty, so JSONproduced with this change is unchanged for any schema that does not set it.
Testing
Adds
FieldSpecTestcoverage: serde round-trip, omitted-when-unset, empty-map-omitted,TimeFieldSpec-through-Schema, deserialization of older JSON without the field,equals/hashCode, and exclusion from the backward-compatibility check.