Skip to content

Add optional old value in replace operation#70

Open
mariotoffia wants to merge 1 commit into
wbish:masterfrom
mariotoffia:master
Open

Add optional old value in replace operation#70
mariotoffia wants to merge 1 commit into
wbish:masterfrom
mariotoffia:master

Conversation

@mariotoffia
Copy link
Copy Markdown

@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.

1 participant