structured-merge-diff icon indicating copy to clipboard operation
structured-merge-diff copied to clipboard

Specifying `{}` to remove nested fields should yield `{}`, not `nil`

Open alexzielenski opened this issue 1 year ago • 9 comments

Consider old object:

{
  requiredField: {
      optionalField1: 1
      optionalFIeld2: 2
   }
}

And patch, all with a single owner

{
    requiredField: {}
}

I expect this to yield:

{
    requiredField: {}
}

But today it yields:

{
    requiredField: nil
}

Which results in an error on k8s since nil is not an acceptable value for this requiredField

alexzielenski avatar May 23 '24 14:05 alexzielenski