ValueTrasnformerTypes - SmartJSONEditor/PublicDocuments GitHub Wiki
JSON (String, Number, Bool, Array) Value Transformer types
Smart JSON Editor offers currently 3 types of JSON value generate/transform:
- Smart Objects / Value (For Smart Objects children)
- JSON Path Relative (For API Responses)
- JSON Path Absolute (For API Responses)
1. Smart Objects / Value
To create a testing JSON structure, use combination of Smart Objects + Smart Objects / Value Value transformer.
Advantages:
- Renaming of Smart Object keys do not break references
- Transformers are automatically treated as Relative and affects all Smart Object shared copies automatically.
Use mainly with combo of Smart Objects
2. JSON Path Relative (For API Responses)
To fetch API data responses and override all values upon JSON Relative Path, use JSON Path Relative. Use mainly on Arrays of Objects as all structure that has same relative JSON Path will be automatically affected by transformer.
Note JSON Path Relative transformers are generated upon relative JSON Path, and are not bounded directly with JsonNode, changing the node key will break reference.
3. JSON Path Absolute (For API Responses)
Use in API Data responses or loaded JSON Files to override a single value.
Value Transformers precedence
You can have associated all 3 types of transformers at time, however in UI and during execution only single value transformer will be used.
The importance is as follows.
- JSON Path Absolute (Will override any previously assigned transformer)
- JSON Path Relative
- Smart Objects / Value
This importance allows having override and affect all values at same JSON Path leaving specific value tweak if needed.