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
+34-33Lines changed: 34 additions & 33 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 (if any match was found).
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), and potential resolution errors in the `msg.error` property.
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).
@@ -73,6 +73,7 @@ In the example, this JSON file is hosted at [`examples/smart-data-models.json`](
It is typically used with a *json-multi-schema-resolver* node in front.
270
274
271
275
### Example of input data
272
-
This is an example of [standard payload](https://fiware-datamodels.readthedocs.io/en/latest/Transportation/Vehicle/Vehicle/doc/spec/index.html), which we want to validate against its [corresponding JSON Schema](https://smart-data-models.github.io/data-models/specs/Transportation/Vehicle/VehicleModel/schema.json), which address is provided by the Node-RED property `msg.schemaUrl`.
276
+
This is an example of [standard payload](https://fiware-datamodels.readthedocs.io/en/latest/Environment/NoiseLevelObserved/doc/spec/index.html#noise-level-observed), which we want to validate against its [corresponding JSON Schema](https://smart-data-models.github.io/data-models/specs/Environment/NoiseLevelObserved/schema.json), which address is provided by the Node-RED property `msg.schemaUrl`.
A disk copy of the downloaded JSON and JSONata documents is kept in cache on disk.
381
-
By default, the cache path is `/tmp/` but that can be changed with the environment variable `SCHEMAS_CACHE_PATH`
382
-
Cached files have a `*.tmp.js` suffix.
383
376
384
377
385
378
@@ -447,8 +440,16 @@ Here is an example of full Node-RED flow: [Node-RED_example_of_HTTP_flow.json](e
447
440
448
441
Read more on the [Node-RED cookbook](https://cookbook.nodered.org/http/serve-json-content).
449
442
450
-
### Caching of schemas
443
+
451
444
452
-
Once downloaded, a copy of the schemas is saved on local disk (by default in `/tmp/`).
445
+
---
446
+
447
+
448
+
449
+
## Caching of schemas
450
+
451
+
A disk copy of the downloaded JSON and JSONata documents is kept in cache on disk.
452
+
By default, the cache path is `/tmp/` but that can be changed with the environment variable `SCHEMAS_CACHE_PATH`
453
+
Cached files have a `*.tmp.js` suffix.
453
454
454
455
If schemas are updated without changing their URL, it is possible to either purge the local cache manually, or add a version number at the end of their URL, such as `https://example.net/a-schema.json?v2`
0 commit comments