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

Feature | Refactor merge logic for recursive and safe array merging #480

Open
wants to merge 2 commits into
base: v3
Choose a base branch
from

Conversation

mfrieswyk
Copy link

Enhanced merge methods to support recursive merging with proper handling of associative and sequential arrays. Introduced helper methods to ensure safe merging and added tests to validate the behavior. This improves flexibility when working with complex nested data structures.

This allows a more flexible developer experience, whereby you can merge a modified body back into the request and all matching nodes will be updated while any new nodes are added.

Enhanced `merge` methods to support recursive merging with proper handling of associative and sequential arrays. Introduced helper methods to ensure safe merging and added tests to validate the behavior. This improves flexibility when working with complex nested data structures.
The 'first_name' field was added to the 'profile' array in the test data to better align with expected data structures. This ensures the tests accurately reflect real-world usage scenarios.
@mfrieswyk mfrieswyk changed the title Refactor merge logic for recursive and safe array merging Feature | Refactor merge logic for recursive and safe array merging Feb 6, 2025
@mikezm
Copy link

mikezm commented Feb 6, 2025

This would be very helpful for some of the more complex payloads we're sending with Saloon now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants