зеркало из https://github.com/Azure/sway.git
Remove rewire. (#61)
* Remove rewire. * switch to ts-common/s-zchema for now. * z-schema => @ts-common/z-schema
This commit is contained in:
Родитель
d2bccb6933
Коммит
2768b08da5
|
@ -29,9 +29,8 @@ var formatGenerators = require('./validation/format-generators');
|
|||
var formatValidators = require('./validation/format-validators');
|
||||
var customValidators = require('./validation/custom-zschema-validators');
|
||||
var JsonRefs = require('json-refs');
|
||||
var rewire = require('rewire');
|
||||
var ZSchemaValidator = rewire('z-schema/src/JsonValidation');
|
||||
var ZSchema = rewire('z-schema');
|
||||
var ZSchemaValidator = require('@ts-common/z-schema/src/JsonValidation');
|
||||
var ZSchema = require('@ts-common/z-schema');
|
||||
// full-date from http://xml2rfc.ietf.org/public/rfc/html/rfc3339.html#anchor14
|
||||
var dateRegExp = new RegExp(
|
||||
'^' +
|
||||
|
@ -110,10 +109,9 @@ function registerFormat (name, validator) {
|
|||
function createJSONValidator () {
|
||||
|
||||
// overwrite validators through rewire until z-schema supports overriding the validators.
|
||||
ZSchemaValidator.__set__('JsonValidators.enum', customValidators.enumValidator);
|
||||
ZSchemaValidator.__set__('JsonValidators.type', customValidators.typeValidator);
|
||||
ZSchemaValidator.__set__('JsonValidators.required', customValidators.requiredPropertyValidator);
|
||||
ZSchema.__set__('JsonValidation', ZSchemaValidator);
|
||||
ZSchemaValidator.JsonValidators.enum = customValidators.enumValidator;
|
||||
ZSchemaValidator.JsonValidators.type = customValidators.typeValidator;
|
||||
ZSchemaValidator.JsonValidators.required = customValidators.requiredPropertyValidator;
|
||||
|
||||
var validator = new ZSchema({
|
||||
breakOnFirstError: false,
|
||||
|
|
|
@ -29,7 +29,7 @@ var helpers = require('../helpers');
|
|||
var JsonRefs = require('json-refs');
|
||||
var supportedHttpMethods = require('swagger-methods');
|
||||
var swaggerSchema = require('swagger-schema-official/schema');
|
||||
var jsonSymbol = require('z-schema').jsonSymbol;
|
||||
var jsonSymbol = require('@ts-common/z-schema').jsonSymbol;
|
||||
|
||||
function getSchemaProperties (schema) {
|
||||
var properties = _.keys(schema.properties); // Start with the defined properties
|
||||
|
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "yasway",
|
||||
"version": "1.3.1",
|
||||
"version": "1.3.2",
|
||||
"description": "A library that simplifies Swagger integrations.",
|
||||
"main": "index.js",
|
||||
"types": "index.d.ts",
|
||||
|
@ -66,8 +66,8 @@
|
|||
"vinyl-source-stream": "^2.0.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"@ts-common/string-map": "^0.2.0",
|
||||
"z-schema": "^3.24.1",
|
||||
"@ts-common/string-map": "^0.2.2",
|
||||
"@ts-common/z-schema": "^3.24.2",
|
||||
"debug": "^3.1.0",
|
||||
"faker": "^4.1.0",
|
||||
"js-base64": "^2.4.8",
|
||||
|
@ -77,7 +77,6 @@
|
|||
"lodash": "^4.17.10",
|
||||
"native-promise-only": "^0.8.1",
|
||||
"path-to-regexp": "^1.7.0",
|
||||
"rewire": "^4.0.1",
|
||||
"swagger-methods": "^1.0.0",
|
||||
"swagger-schema-official": "2.0.0-bab6bed"
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче