har-validator
Advanced tools
Comparing version 1.6.0 to 1.6.1
{ | ||
"version": "1.6.0", | ||
"version": "1.6.1", | ||
"name": "har-validator", | ||
@@ -4,0 +4,0 @@ "description": "Extremely fast HTTP Archive (HAR) validator using JSON Schema", |
'use strict' | ||
var schemas = require('./schemas') | ||
var ValidationError = require('./error') | ||
var validator = require('is-my-json-valid') | ||
function ValidationError (errors) { | ||
this.name = 'ValidationError' | ||
this.errors = errors | ||
} | ||
ValidationError.prototype = Error.prototype | ||
// is-my-json-valid does not provide meaningful error messages for external schemas | ||
// this is a workaround | ||
schemas.cache.properties.beforeRequest = schemas.cacheEntry | ||
schemas.cache.properties.afterRequest = schemas.cacheEntry | ||
schemas.page.properties.pageTimings = schemas.pageTimings | ||
schemas.request.properties.cookies.items = schemas.cookie | ||
schemas.request.properties.headers.items = schemas.record | ||
schemas.request.properties.queryString.items = schemas.record | ||
schemas.request.properties.postData = schemas.postData | ||
schemas.response.properties.cookies.items = schemas.cookie | ||
schemas.response.properties.headers.items = schemas.record | ||
schemas.response.properties.content = schemas.content | ||
schemas.entry.properties.request = schemas.request | ||
schemas.entry.properties.response = schemas.response | ||
schemas.entry.properties.cache = schemas.cache | ||
schemas.entry.properties.timings = schemas.timings | ||
schemas.log.properties.creator = schemas.creator | ||
schemas.log.properties.browser = schemas.creator | ||
schemas.log.properties.pages.items = schemas.page | ||
schemas.log.properties.entries.items = schemas.entry | ||
schemas.har.properties.log = schemas.log | ||
var runner = function (schema, data, cb) { | ||
@@ -42,0 +8,0 @@ var validate = validator(schema, { |
'use strict' | ||
module.exports = { | ||
var schemas = { | ||
cache: require('./cache.json'), | ||
@@ -20,1 +20,31 @@ cacheEntry: require('./cacheEntry.json'), | ||
} | ||
// is-my-json-valid does not provide meaningful error messages for external schemas | ||
// this is a workaround | ||
schemas.cache.properties.beforeRequest = schemas.cacheEntry | ||
schemas.cache.properties.afterRequest = schemas.cacheEntry | ||
schemas.page.properties.pageTimings = schemas.pageTimings | ||
schemas.request.properties.cookies.items = schemas.cookie | ||
schemas.request.properties.headers.items = schemas.record | ||
schemas.request.properties.queryString.items = schemas.record | ||
schemas.request.properties.postData = schemas.postData | ||
schemas.response.properties.cookies.items = schemas.cookie | ||
schemas.response.properties.headers.items = schemas.record | ||
schemas.response.properties.content = schemas.content | ||
schemas.entry.properties.request = schemas.request | ||
schemas.entry.properties.response = schemas.response | ||
schemas.entry.properties.cache = schemas.cache | ||
schemas.entry.properties.timings = schemas.timings | ||
schemas.log.properties.creator = schemas.creator | ||
schemas.log.properties.browser = schemas.creator | ||
schemas.log.properties.pages.items = schemas.page | ||
schemas.log.properties.entries.items = schemas.entry | ||
schemas.har.properties.log = schemas.log | ||
module.exports = schemas |
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
21196
22
540