@spinajs/validation
Advanced tools
Comparing version 1.1.2 to 1.1.3
import { SyncModule, IContainer } from "@spinajs/di"; | ||
import Ajv from "ajv"; | ||
import { Configuration } from "@spinajs/configuration"; | ||
import { ValidationError } from "./exceptions"; | ||
@@ -9,5 +8,5 @@ export declare class DataValidator extends SyncModule { | ||
protected Validator: Ajv; | ||
protected Configuration: Configuration; | ||
protected Container: IContainer; | ||
resolve(container: IContainer): void; | ||
addSchema(schemaObject: any, identifier: string): void; | ||
/** | ||
@@ -14,0 +13,0 @@ * |
@@ -85,9 +85,13 @@ "use strict"; | ||
.forEach(s => { | ||
var _a, _b; | ||
const schemaName = (_a = s.schema.$id) !== null && _a !== void 0 ? _a : path.basename(s.file); | ||
this.Validator.addSchema(s.schema, (_b = s.schema.$id) !== null && _b !== void 0 ? _b : path.basename(s.file)); | ||
log_1.Log.info(`Schema ${schemaName} added !`, "validator"); | ||
var _a; | ||
this.addSchema(s.schema, (_a = s.schema.$id) !== null && _a !== void 0 ? _a : path.basename(s.file)); | ||
}); | ||
super.resolve(container); | ||
} | ||
addSchema(schemaObject, identifier) { | ||
if (!this.hasSchema(identifier)) { | ||
this.Validator.addSchema(schemaObject, identifier); | ||
log_1.Log.trace(`Schema ${identifier} added !`, "validator"); | ||
} | ||
} | ||
/** | ||
@@ -94,0 +98,0 @@ * |
{ | ||
"name": "@spinajs/validation", | ||
"version": "1.1.2", | ||
"version": "1.1.3", | ||
"description": "validation library for spinajs framework", | ||
@@ -39,6 +39,6 @@ "main": "lib/index.js", | ||
"dependencies": { | ||
"@spinajs/configuration": "^1.1.2", | ||
"@spinajs/configuration": "^1.1.4", | ||
"@spinajs/di": "^1.1.7", | ||
"@spinajs/exceptions": "^1.0.5", | ||
"@spinajs/log": "^1.1.0", | ||
"@spinajs/log": "^1.1.1", | ||
"ajv": "^8.8.2", | ||
@@ -45,0 +45,0 @@ "ajv-formats": "^2.1.1", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
48063
733
0
Updated@spinajs/log@^1.1.1