You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+5-3Lines changed: 5 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -30,7 +30,7 @@ Here is an example of full Node-RED flow: [Node-RED_example_of_flow.json](exampl
30
30
**Purpose*: Ability to determine the URL of the JSON Schema (e.g. FIWARE NGSI) or JSONata expression to use for a given JSON payload received.
31
31
**Configuration*: A Node-RED `mappingsUrl` property to indicate the URL of a file listing which JSON Schema or JSONata expression to use for which data input. (See examples below).
32
32
**Input*: A JSON observation (e.g. one of the FIWARE NGSI types) in the `msg.payload` property.
33
-
**Output*: The unmodified JSON observation in the `msg.payload` property, and the resolved schema URL in the `msg.schemaUrl` property.
33
+
**Output*: The unmodified JSON observation in the `msg.payload` property, and the resolved schema URL in the `msg.schemaUrl` property (if any match was found).
34
34
35
35
### Example of input data
36
36
This is an example of [standard payload](https://fiware-datamodels.readthedocs.io/en/latest/Transportation/Vehicle/Vehicle/doc/spec/index.html), for which we need to look-up the [corresponding JSON Schema](https://smart-data-models.github.io/data-models/specs/Transportation/Vehicle/VehicleModel/schema.json).
@@ -166,7 +166,8 @@ Output:
166
166
**Context*: Node-RED node, or command line with `index.js multi-schema-transformer`
167
167
**Purpose*: Ability to transform a JSON observation on the fly from whichever format to another format (e.g. one of the FIWARE NGSI types) using a specified JSONata URL. Schemas are automatically downloaded and cached the first time they are needed.
168
168
**Input*: A JSON observation in whichever format in the `msg.payload` property, and the corresponding JSONata URL on the `msg.schemaUrl` property (coming from json-multi-schema-resolver).
169
-
**Output*: The transformed JSON observation in the `msg.payload` property, and potential validation errors in the `msg.error` property.
169
+
* If no `msg.schemaUrl` is provided, no transformation is performed.
170
+
**Output*: The transformed JSON observation in the `msg.payload` property, the used JSONata in the `msg.transformUrl` (if any transformation was performed), and potential validation errors in the `msg.error` property.
170
171
**Implementation*: Based on [JSONata](https://github.com/jsonata-js/jsonata).
171
172
172
173
It is typically used with a *json-multi-schema-resolver* node in front.
@@ -261,7 +262,8 @@ Output:
261
262
**Context*: Node-RED node, or command line with `./index.js json-multi-schema-validator`
262
263
**Purpose*: Ability to validate a JSON observation (e.g. one of the FIWARE NGSI types) on the fly against a specified JSON Schema URL. Schemas are automatically downloaded and cached the first time they are needed.
263
264
**Input*: A JSON observation (e.g. one of the FIWARE NGSI types) in the `msg.payload` property, and the corresponding JSON Schema URL on the `msg.schemaUrl` property (coming from json-multi-schema-resolver).
264
-
**Output*: The unmodified JSON observation in the `msg.payload` property, and potential validation errors in the `msg.error` property.
265
+
* If no `msg.schemaUrl` is provided, no validation is performed.
266
+
**Output*: The unmodified JSON observation in the `msg.payload` property, the used schema in the `msg.validUrl` (if any validation was performed), and potential validation errors in the `msg.error` property.
265
267
**Implementation*: Based on [AJV](https://ajv.js.org).
266
268
267
269
It is typically used with a *json-multi-schema-resolver* node in front.
Copy file name to clipboardExpand all lines: json-multi-schema-transformer.html
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -25,8 +25,8 @@
25
25
<p>Node to transform a JSON observation to another format using a configurable set of JSONata rules.</p>
26
26
<ul>
27
27
<li>The node will transform a given JSON payload received in <code>msg.payload</code> using some JSONata rules, which URL is given in <code>msg.schemaUrl</code></li>
<li>The transformed payload is returned in <code>msg.payload</code>. If no <code>msg.schemaUrl</code> is provided, no transformation is performed.</li>
Copy file name to clipboardExpand all lines: package.json
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
{
2
2
"name": "node-red-contrib-json-multi-schema",
3
-
"version": "0.5.0",
3
+
"version": "0.5.1",
4
4
"description": "Generic JSON data pipeline tools, with dynamic transformation (using JSONata rules), resolving JSON Schema (using JSONata rules), and then validation (using JSON Schema). For Node-RED and for command-line.",
0 commit comments