mirror of
https://github.com/node-red/node-red.git
synced 2025-03-01 10:36:34 +00:00
JSON node: delete msg.schema before sending msg to avoid conflicts
This commit is contained in:
@@ -56,6 +56,7 @@ module.exports = function(RED) {
|
||||
RED.util.setMessageProperty(msg,node.property,JSON.parse(value));
|
||||
if (validate) {
|
||||
if (this.compiledSchema(msg[node.property])) {
|
||||
delete msg.schema;
|
||||
node.send(msg);
|
||||
} else {
|
||||
msg.schemaError = this.compiledSchema.errors;
|
||||
@@ -70,6 +71,7 @@ module.exports = function(RED) {
|
||||
// If node.action is str and value is str
|
||||
if (validate) {
|
||||
if (this.compiledSchema(JSON.parse(msg[node.property]))) {
|
||||
delete msg.schema;
|
||||
node.send(msg);
|
||||
} else {
|
||||
msg.schemaError = this.compiledSchema.errors;
|
||||
@@ -87,6 +89,7 @@ module.exports = function(RED) {
|
||||
if (validate) {
|
||||
if (this.compiledSchema(value)) {
|
||||
RED.util.setMessageProperty(msg,node.property,JSON.stringify(value,null,node.indent));
|
||||
delete msg.schema;
|
||||
node.send(msg);
|
||||
} else {
|
||||
msg.schemaError = this.compiledSchema.errors;
|
||||
@@ -104,6 +107,7 @@ module.exports = function(RED) {
|
||||
// If node.action is obj and value is object
|
||||
if (validate) {
|
||||
if (this.compiledSchema(value)) {
|
||||
delete msg.schema;
|
||||
node.send(msg);
|
||||
} else {
|
||||
msg.schemaError = this.compiledSchema.errors;
|
||||
|
Reference in New Issue
Block a user