OutSystems Forge 日本語データベース

JSON_Compare

※Forge全件データの日本語検索サービスをご利用になりたい場合は、こちらまでお問合せください。

Forge英文サイト

2017-11-29 1.0.0 Steven Phipps All .NET Developer Tools
2つのJSON文字列を比較する小さな拡張。 これを使ってレコードのユーザー変更を監査します。
2つのJSON文字列をテキストで比較します。再帰オブジェクトと配列で動作します。 オプションのパラメータを使用すると、結果の文字列を書式設定できます。 パラメータ 説明 デフォルト KeyPrefix 変更されたプロパティのキー名の前に挿入されたテキスト "" KeySuffix 変更されたプロパティのキー名の後に挿入されるテキスト ":" ChangeSeparator 変更された値の間に挿入されるテキスト ">" PropertySeparator プロパティ間のテキスト区切り文字 "、" ExcludeProperties 比較されず、結果に含まれないキー名のリスト "ChangedBy; DateChanged; Changed" 例 これら2つのJSON文字列を比較すると、 { "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" ] } ] } デフォルトの結果は次のとおりです。 name: John > Johnny, models[1]: Focus > Ka, models[0]: 320 > 350, name: Fiat > Seat

[Overview]
Small extension to compare two JSON strings. I use it to audit user changes to records
[Detail]
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
戻る