Skip to content

Commit

Permalink
Merge pull request #5 from jehy/master
Browse files Browse the repository at this point in the history
bump package versions, use logger from debug
  • Loading branch information
bollwar404 committed Feb 6, 2019
2 parents a3f3edb + edfa024 commit 81c61fd
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
10 changes: 8 additions & 2 deletions index.js
Expand Up @@ -5,7 +5,13 @@ const toOpenApi = require('json-schema-to-openapi-schema');
const OpenAPISchemaValidator = require('openapi-schema-validator').default;
const debug = require('debug')('ajvToSwagger');

const ajv = new Ajv({ verbose: true, allErrors: true });
const ajvLoger = {
log: (...args) => { debug('LOG', ...args); },
warn: (...args) => { debug('WARN', ...args); },
error: (...args) => { debug('ERROR', ...args); },
};

const ajv = new Ajv({ verbose: true, allErrors: true, logger: ajvLoger });
const swaggerBase = require('./files/swaggerDraft.json');

function clone(obj) {
Expand Down Expand Up @@ -45,7 +51,7 @@ function convertSchema(schema, options = { validate: true }) {
try {
ajv.compile(schema);
} catch (err) {
debug('AJV validation failed, chema is invalid');
debug('AJV validation failed, schema is invalid');
throw err;
}
debug('schema is valid');
Expand Down
12 changes: 6 additions & 6 deletions package.json
@@ -1,6 +1,6 @@
{
"name": "ajv-to-swagger",
"version": "1.0.2",
"version": "1.0.3",
"description": "convert from ajv to swagger",
"main": "Swagger.js",
"scripts": {
Expand All @@ -26,19 +26,19 @@
},
"homepage": "https://github.com/bollwar404/ajv-to-swagger#readme",
"dependencies": {
"ajv": "6.7.0",
"ajv": "6.8.1",
"debug": "^4.1.1",
"json-schema-to-openapi-schema": "0.3.0",
"openapi-schema-validator": "3.0.2"
"openapi-schema-validator": "3.0.3"
},
"devDependencies": {
"chai": "^4.2.0",
"coveralls": "^3.0.2",
"eslint": "^5.12.0",
"eslint": "^5.13.0",
"eslint-config-airbnb-base": "^13.1.0",
"eslint-plugin-import": "^2.14.0",
"eslint-plugin-import": "^2.16.0",
"mocha": "^5.2.0",
"nyc": "^13.1.0"
"nyc": "^13.2.0"
},
"engines": {
"node": ">=8"
Expand Down

0 comments on commit 81c61fd

Please sign in to comment.