Created on 29 November 2017
icon_unfollowing
Login to follow
json-compare

JSON_Compare

Stable version 1.0.0 (Compatible with OutSystems 11)
Also available for 10
Uploaded on 29 November 2017 by 
json-compare

JSON_Compare

Details
Small extension to compare two JSON strings. I use it to audit user changes to records
Read more

Gives a textual comparison between two JSON strings. Works with recursive objects and with arrays.

Optional parameters allow some formatting of the result string:

Parameter
Description
Default
KeyPrefix
Text inserted before the key name of the changed property
""
KeySuffix
Text inserted after the key name of the changed property
": "
ChangeSeparator
Text inserted between changed values
" > "
PropertySeparator
Text separator between properties
", "
ExcludeProperties
List of key names that will not be compared and not included in the result
"ChangedBy;DateChanged;Changed"


Example

Comparing these two JSON strings:

{
    "name":"John",
    "age":30,
    "cars": [
        { "name":"Ford", "models":[ "Fiesta", "Focus", "Mustang" ] },
        { "name":"BMW", "models":[ "320", "X3", "X5" ] },
        { "name":"Fiat", "models":[ "500", "Panda" ] }
    ]
 }

{
    "name":"Johnny",
    "age":30,
    "cars": [
        { "name":"Ford", "models":[ "Fiesta", "Ka", "Mustang" ] },
        { "name":"BMW", "models":[ "350", "X3", "X5" ] },
        { "name":"Seat", "models":[ "500", "Panda" ] }
    ]
 }

The default result is:

name: John > Johnny, models[1]: Focus > Ka, models[0]: 320 > 350, name: Fiat > Seat



Release notes (1.0.0)
Reviews (0)
Category
Functional libraries & utilities, Other functions & libraries
Tags
Support options
This asset is not supported by OutSystems. You may use the discussion forums to leave suggestions or obtain best-effort support from the community, including from  who created this asset.
Dependencies
JSON_Compare has no dependencies.
Application Objects
JSON_Compare has 0 AOs.
Team
Compatible with
Version 11
Version 10
Stack:
.NET
Database:
All
Asset consumers
No consumers yet.
Weekly downloads