mirror of
				https://github.com/node-red/node-red.git
				synced 2025-03-01 10:36:34 +00:00 
			
		
		
		
	Update ajv to 8.2.0 - drop support for JSON-Schema draft-04
This commit is contained in:
		| @@ -26,7 +26,7 @@ | |||||||
|         } |         } | ||||||
|     ], |     ], | ||||||
|     "dependencies": { |     "dependencies": { | ||||||
|         "ajv": "6.12.6", |         "ajv": "8.2.0", | ||||||
|         "async-mutex": "0.3.1", |         "async-mutex": "0.3.1", | ||||||
|         "basic-auth": "2.0.1", |         "basic-auth": "2.0.1", | ||||||
|         "bcryptjs": "2.4.3", |         "bcryptjs": "2.4.3", | ||||||
|   | |||||||
| @@ -17,8 +17,7 @@ | |||||||
| module.exports = function(RED) { | module.exports = function(RED) { | ||||||
|     "use strict"; |     "use strict"; | ||||||
|     const Ajv = require('ajv'); |     const Ajv = require('ajv'); | ||||||
|     const ajv = new Ajv({allErrors: true, schemaId: 'auto'}); |     const ajv = new Ajv({allErrors: true}); | ||||||
|     ajv.addMetaSchema(require('ajv/lib/refs/json-schema-draft-04.json')); |  | ||||||
|     ajv.addMetaSchema(require('ajv/lib/refs/json-schema-draft-06.json')); |     ajv.addMetaSchema(require('ajv/lib/refs/json-schema-draft-06.json')); | ||||||
|  |  | ||||||
|     function JSONNode(n) { |     function JSONNode(n) { | ||||||
|   | |||||||
| @@ -15,7 +15,7 @@ | |||||||
|         } |         } | ||||||
|     ], |     ], | ||||||
|     "dependencies": { |     "dependencies": { | ||||||
|         "ajv": "6.12.6", |         "ajv": "8.2.0", | ||||||
|         "body-parser": "1.19.0", |         "body-parser": "1.19.0", | ||||||
|         "cheerio": "0.22.0", |         "cheerio": "0.22.0", | ||||||
|         "content-type": "1.0.4", |         "content-type": "1.0.4", | ||||||
|   | |||||||
| @@ -389,7 +389,7 @@ describe('JSON node', function() { | |||||||
|                         }); |                         }); | ||||||
|                         logEvents.should.have.length(1); |                         logEvents.should.have.length(1); | ||||||
|                         logEvents[0][0].should.have.a.property('msg'); |                         logEvents[0][0].should.have.a.property('msg'); | ||||||
|                         logEvents[0][0].msg.should.equal("json.errors.schema-error: data.number should be number, data.string should be string"); |                         logEvents[0][0].msg.should.startWith("json.errors.schema-error"); | ||||||
|                         logEvents[0][0].should.have.a.property('level',helper.log().ERROR); |                         logEvents[0][0].should.have.a.property('level',helper.log().ERROR); | ||||||
|                         done(); |                         done(); | ||||||
|                     } catch(err) { done(err) } |                     } catch(err) { done(err) } | ||||||
| @@ -417,7 +417,7 @@ describe('JSON node', function() { | |||||||
|                         }); |                         }); | ||||||
|                         logEvents.should.have.length(1); |                         logEvents.should.have.length(1); | ||||||
|                         logEvents[0][0].should.have.a.property('msg'); |                         logEvents[0][0].should.have.a.property('msg'); | ||||||
|                         logEvents[0][0].msg.should.equal("json.errors.schema-error: data.number should be number, data.string should be string"); |                         logEvents[0][0].msg.should.startWith("json.errors.schema-error"); | ||||||
|                         logEvents[0][0].should.have.a.property('level',helper.log().ERROR); |                         logEvents[0][0].should.have.a.property('level',helper.log().ERROR); | ||||||
|                         done(); |                         done(); | ||||||
|                     } catch(err) { done(err) } |                     } catch(err) { done(err) } | ||||||
| @@ -445,7 +445,7 @@ describe('JSON node', function() { | |||||||
|                         }); |                         }); | ||||||
|                         logEvents.should.have.length(1); |                         logEvents.should.have.length(1); | ||||||
|                         logEvents[0][0].should.have.a.property('msg'); |                         logEvents[0][0].should.have.a.property('msg'); | ||||||
|                         logEvents[0][0].msg.should.equal("json.errors.schema-error: data.number should be number, data.string should be string"); |                         logEvents[0][0].msg.should.startWith("json.errors.schema-error"); | ||||||
|                         logEvents[0][0].should.have.a.property('level',helper.log().ERROR); |                         logEvents[0][0].should.have.a.property('level',helper.log().ERROR); | ||||||
|                         done(); |                         done(); | ||||||
|                     } catch(err) { done(err) } |                     } catch(err) { done(err) } | ||||||
| @@ -473,7 +473,7 @@ describe('JSON node', function() { | |||||||
|                         }); |                         }); | ||||||
|                         logEvents.should.have.length(1); |                         logEvents.should.have.length(1); | ||||||
|                         logEvents[0][0].should.have.a.property('msg'); |                         logEvents[0][0].should.have.a.property('msg'); | ||||||
|                         logEvents[0][0].msg.should.equal("json.errors.schema-error: data.number should be number, data.string should be string"); |                         logEvents[0][0].msg.should.startWith("json.errors.schema-error"); | ||||||
|                         logEvents[0][0].should.have.a.property('level',helper.log().ERROR); |                         logEvents[0][0].should.have.a.property('level',helper.log().ERROR); | ||||||
|                         done(); |                         done(); | ||||||
|                     } catch(err) { done(err) } |                     } catch(err) { done(err) } | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user