Preserve retained input presence in nested CLI overrides
This commit is contained in:
@@ -38,7 +38,10 @@ func applyDecodedOverrides(
|
||||
}
|
||||
presence := cloneInputPresence(decoded.presence)
|
||||
origins := cloneOrigins(decoded.origins)
|
||||
currentProjection := document.Clone(decoded.final)
|
||||
var lookup *documentLookup
|
||||
if len(batch.overrides) != 0 {
|
||||
lookup = buildDocumentLookup(decoded.final)
|
||||
}
|
||||
|
||||
for _, override := range batch.overrides {
|
||||
if len(override.path.segments) == 0 {
|
||||
@@ -56,8 +59,11 @@ func applyDecodedOverrides(
|
||||
|
||||
location := document.Location{SourceID: override.source.ID}
|
||||
recordOverrideAncestors(presence, origins, override.path, location)
|
||||
updateOverridePresence(presence, currentProjection, override.value, override.path, location)
|
||||
updateOverrideOrigins(origins, currentProjection, override.value, override.path, location)
|
||||
// Prepared paths cannot overlap, so other assignments cannot change
|
||||
// this target's pre-CLI subtree.
|
||||
existing, _ := documentAtPathWithLookup(decoded.final, override.path, lookup)
|
||||
updateOverridePresence(presence, existing, override.value, override.path, location)
|
||||
updateOverrideOrigins(origins, existing, override.value, override.path, location)
|
||||
}
|
||||
final, projectionIssue := projectConfiguration(schema, working, defaultProjectionLimits())
|
||||
if projectionIssue != nil {
|
||||
|
||||
Reference in New Issue
Block a user