Skip to content

Commit 70b3ddf

Browse files
committed
#1204 enabled multipleOfPrecision for validation to address rounding errors
1 parent ab29e9f commit 70b3ddf

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/controller/cve.controller/cve.middleware.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const cnaContainerSchema = JSON.parse(fs.readFileSync('src/middleware/schemas/5.
88
const logger = require('../../middleware/logger')
99
const Ajv = require('ajv')
1010
const addFormats = require('ajv-formats')
11-
const ajv = new Ajv({ allErrors: true })
11+
const ajv = new Ajv({ allErrors: false, multipleOfPrecision: 6 })
1212
addFormats(ajv)
1313
const validateRejected = ajv.compile(RejectedSchema)
1414
const validateCnaContainer = ajv.compile(cnaContainerSchema)

src/model/cve.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ const cveSchemaV5 = JSON.parse(fs.readFileSync('src/middleware/schemas/CVE_JSON_
66

77
const Ajv = require('ajv')
88
const addFormats = require('ajv-formats')
9-
const ajv = new Ajv({ allErrors: true })
9+
const ajv = new Ajv({ allErrors: false, multipleOfPrecision: 6, verbose: true })
1010
addFormats(ajv)
1111
const validate = ajv.compile(cveSchemaV5)
1212
const getConstants = require('../constants').getConstants

0 commit comments

Comments
 (0)