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

Add optional old value in replace operation #70

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mariotoffia
Copy link

@mariotoffia mariotoffia commented Feb 12, 2024

Hi @wbish,

When OperationTypes.Replace it will capture the replace value and add it to the operation. The old property is only JSON visible when not null. Hence, the following output can be achieved:

The diff:

{"building":{"loc":{"provision":["2023-12-18T15:08:26Z","2024-02-01T16:00:00Z"]}}}

The json delta formatter:

[{"path":"/building/loc/provision","op":"replace","value":"2024-02-01T16:00:00Z","old":"2023-12-18T15:08:26Z"}]

I'm on a Mac and do not have mono, so sorry for not providing any unit test - I've used it in my other project code and it seems to work properly.

I hope, this is a valid contribution. Please tell me otherwise and I'll fix it.

Cheers,
Mario :)

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.

None yet

1 participant