Skip to content
Snippets Groups Projects
Commit 8926d58e authored by michael.kainz's avatar michael.kainz
Browse files

Added ajv-formats for migration

parent df0571c3
No related branches found
No related tags found
No related merge requests found
...@@ -28,6 +28,7 @@ ...@@ -28,6 +28,7 @@
"@fastify/swagger-ui": "^3.0.0", "@fastify/swagger-ui": "^3.0.0",
"@fastify/url-data": "^5.4.0", "@fastify/url-data": "^5.4.0",
"ajv": "^8.0.0", "ajv": "^8.0.0",
"ajv-formats": "^3.0.1",
"bull": "^4.12.2", "bull": "^4.12.2",
"dotenv-defaults": "^5.0.2", "dotenv-defaults": "^5.0.2",
"fastify": "^4.26.2", "fastify": "^4.26.2",
...@@ -98,4 +99,4 @@ ...@@ -98,4 +99,4 @@
"recursive": true "recursive": true
}, },
"packageManager": "pnpm@8.15.6" "packageManager": "pnpm@8.15.6"
} }
\ No newline at end of file
...@@ -37,6 +37,9 @@ dependencies: ...@@ -37,6 +37,9 @@ dependencies:
ajv: ajv:
specifier: ^8.0.0 specifier: ^8.0.0
version: 8.12.0 version: 8.12.0
ajv-formats:
specifier: ^3.0.1
version: 3.0.1(ajv@8.12.0)
bull: bull:
specifier: ^4.12.2 specifier: ^4.12.2
version: 4.12.2 version: 4.12.2
...@@ -518,6 +521,17 @@ packages: ...@@ -518,6 +521,17 @@ packages:
ajv: 8.12.0 ajv: 8.12.0
dev: false dev: false
/ajv-formats@3.0.1(ajv@8.12.0):
resolution: {integrity: sha512-8iUql50EUR+uUcdRQ3HDqa6EVyo3docL8g5WJ3FNcWmu62IbkGUue/pEyLBW8VGKKucTPgqeks4fIU1DA4yowQ==}
peerDependencies:
ajv: ^8.0.0
peerDependenciesMeta:
ajv:
optional: true
dependencies:
ajv: 8.12.0
dev: false
/ajv@6.12.6: /ajv@6.12.6:
resolution: {integrity: sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==} resolution: {integrity: sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==}
dependencies: dependencies:
......
...@@ -18,20 +18,21 @@ ...@@ -18,20 +18,21 @@
* Any use of the work other than as authorized under this license or copyright law is prohibited. * Any use of the work other than as authorized under this license or copyright law is prohibited.
*/ */
import { get } from '../cache.js'
import Ajv from 'ajv' import Ajv from 'ajv'
import fs from 'node:fs' import fs from 'node:fs'
import addFormats from 'ajv-formats'
import { get } from '../cache.js'
import { getRedisKey } from '../util.js' import { getRedisKey } from '../util.js'
const appRoot = process.env.APP_ROOT const appRoot = process.env.APP_ROOT
const ajv = new Ajv({ allErrors: true }) const ajv = new Ajv({ allErrors: true })
ajv.addSchema( ajv.addSchema(
fs.readdirSync('src/schemas/', 'utf8').map(file => { fs.readdirSync('src/schemas/', 'utf8').map(file => {
return JSON.parse(fs.readFileSync(`src/schemas/${file}`, 'utf8')) return JSON.parse(fs.readFileSync(`src/schemas/${file}`, 'utf8'))
}) })
) )
addFormats(ajv)
const template = { const template = {
// custom values // custom values
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment