Add optional extraMetadata map to FieldSpec#18984
Draft
navina wants to merge 1 commit into
Draft
Conversation
Add an optional, additive Map<String, String> extraMetadata to FieldSpec for free-form per-column metadata, mirroring the existing optional fieldId/aliases: @JsonInclude(NON_EMPTY) so it is omitted when unset/empty, excluded from isBackwardCompatibleWith, and round-tripped via the shared appendFieldIdAliasesAndMetadata 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.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #18984 +/- ##
=========================================
Coverage 65.05% 65.06%
Complexity 1403 1403
=========================================
Files 3399 3399
Lines 212808 212817 +9
Branches 33568 33571 +3
=========================================
+ Hits 138443 138467 +24
+ Misses 63223 63213 -10
+ Partials 11142 11137 -5
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.
Summary
Adds an optional, additive
Map<String, String> extraMetadatatoFieldSpecfor free-formper-column metadata, mirroring the existing optional
fieldId/aliases.Details
@JsonInclude(NON_EMPTY)— omitted from serialization when unset/empty.isBackwardCompatibleWith(purely additive, never affects compatibility).appendFieldIdAliasesAndMetadatahelper, 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.