Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bump package versions, use logger from debug #5

Merged
merged 1 commit into from
Feb 6, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 8 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
@@ -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