Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Union does not perform deep merge or keep property order #2885

Closed
BernieWhite opened this issue May 23, 2024 · 0 comments · Fixed by #2886
Closed

[BUG] Union does not perform deep merge or keep property order #2885

BernieWhite opened this issue May 23, 2024 · 0 comments · Fixed by #2886
Assignees
Labels
bug Something isn't working feature: pre-flight-expansion Issues relating to expansion of ARM and Bicep.
Milestone

Comments

@BernieWhite
Copy link
Collaborator

Existing rule

No response

Description of the issue

When using union:

  • Nested properties of object should also be merged instead of replaced.
  • Property order should preserve.

Error messages

No response

Reproduction

var firstObject = {
  property: {
    one: 'a'
    two: 'b'
    three: 'c1'
  }
  nestedArray: [
    1
    2
  ]
}
var secondObject = {
  property: {
    three: 'c2'
    four: 'd'
    five: 'e'
  }
  nestedArray: [
    3
    4
  ]
}
output objectOutput object = union(firstObject, secondObject)

Should return the output:

{"property":{"one":"a","two":"b","three":"c2","four":"d","five":"e"},"nestedArray":[3,4]}

Version of PSRule

2.9.0

Version of PSRule for Azure

1.26.0

Additional context

@BernieWhite BernieWhite added bug Something isn't working feature: pre-flight-expansion Issues relating to expansion of ARM and Bicep. labels May 23, 2024
@BernieWhite BernieWhite added this to the v1.37.0 milestone May 23, 2024
@BernieWhite BernieWhite self-assigned this May 23, 2024
BernieWhite added a commit to BernieWhite/PSRule.Rules.Azure that referenced this issue May 23, 2024
@BernieWhite BernieWhite mentioned this issue Jun 5, 2024
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working feature: pre-flight-expansion Issues relating to expansion of ARM and Bicep.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant