HAR SDK enables Node.js developers to easily work with HAR, convert it from OAS/Swagger and Postman collection, and more.
MIT License
Bot releases are visible (Hide)
Published by derevnjuk almost 3 years ago
Published by derevnjuk almost 3 years ago
Published by derevnjuk almost 3 years ago
Published by derevnjuk almost 3 years ago
Published by derevnjuk almost 3 years ago
Published by derevnjuk almost 3 years ago
verify
method has been reworked. In case of validation failure, the returned promise is resolved with an array of ErrorObject
instances.Before:
import { OpenAPIV2 } from '@har-sdk/types';
import { OASValidator, Validator } from '@har-sdk/validator';
const doc = {
swagger: '2.0',
host: 'http://localhost:3000',
info: {
title: 'Some valid API document',
version: '1.0.0'
},
paths: {}
} as OpenAPIV2.Document;
const result = await new OASValidator().verify(doc);
console.log(result);
// {
// valid: false,
// errors: [
// {
// instancePath: '/info',
// schemaPath: '#/required',
// keyword: 'required',
// params: { missingProperty: 'version' },
// message: "must have required property 'version'"
// }
// ]
// }
After:
import { OpenAPIV2 } from '@har-sdk/types';
import { OASValidator, ErrorHumanizer } from '@har-sdk/validator';
const doc = {
swagger: '2.0',
host: 'localhost',
info: {
title: 'Some valid API document'
},
paths: {}
} as OpenAPIV2.Document;
const errors = await new OASValidator().verify(doc);
console.log(errors);
// [
// {
// instancePath: '/info',
// schemaPath: '#/required',
// keyword: 'required',
// params: { missingProperty: 'version' },
// message: "must have required property 'version'"
// }
// ]
Published by derevnjuk almost 3 years ago
verify
method has been reworked. In case of validation failure, the returned promise is resolved with an array of ErrorObject
instances.Before:
import { OpenAPIV2 } from '@har-sdk/types';
import { OASValidator, Validator } from '@har-sdk/validator';
const doc = {
swagger: '2.0',
host: 'http://localhost:3000',
info: {
title: 'Some valid API document',
version: '1.0.0'
},
paths: {}
} as OpenAPIV2.Document;
const result = await new OASValidator().verify(doc);
console.log(result);
// {
// valid: false,
// errors: [
// {
// instancePath: '/info',
// schemaPath: '#/required',
// keyword: 'required',
// params: { missingProperty: 'version' },
// message: "must have required property 'version'"
// }
// ]
// }
After:
import { OpenAPIV2 } from '@har-sdk/types';
import { OASValidator, ErrorHumanizer } from '@har-sdk/validator';
const doc = {
swagger: '2.0',
host: 'localhost',
info: {
title: 'Some valid API document'
},
paths: {}
} as OpenAPIV2.Document;
const errors = await new OASValidator().verify(doc);
console.log(errors);
// [
// {
// instancePath: '/info',
// schemaPath: '#/required',
// keyword: 'required',
// params: { missingProperty: 'version' },
// message: "must have required property 'version'"
// }
// ]
Published by derevnjuk almost 3 years ago
verify
method has been reworked. In case of validation failure, the returned promise is resolved with an array of ErrorObject
instances.Before:
import { OpenAPIV2 } from '@har-sdk/types';
import { OASValidator, Validator } from '@har-sdk/validator';
const doc = {
swagger: '2.0',
host: 'http://localhost:3000',
info: {
title: 'Some valid API document',
version: '1.0.0'
},
paths: {}
} as OpenAPIV2.Document;
const result = await new OASValidator().verify(doc);
console.log(result);
// {
// valid: false,
// errors: [
// {
// instancePath: '/info',
// schemaPath: '#/required',
// keyword: 'required',
// params: { missingProperty: 'version' },
// message: "must have required property 'version'"
// }
// ]
// }
After:
import { OpenAPIV2 } from '@har-sdk/types';
import { OASValidator, ErrorHumanizer } from '@har-sdk/validator';
const doc = {
swagger: '2.0',
host: 'localhost',
info: {
title: 'Some valid API document'
},
paths: {}
} as OpenAPIV2.Document;
const errors = await new OASValidator().verify(doc);
console.log(errors);
// [
// {
// instancePath: '/info',
// schemaPath: '#/required',
// keyword: 'required',
// params: { missingProperty: 'version' },
// message: "must have required property 'version'"
// }
// ]
Published by derevnjuk almost 3 years ago
verify
method has been reworked. In case of validation failure, the returned promise is resolved with an array of ErrorObject
instances.Before:
import { OpenAPIV2 } from '@har-sdk/types';
import { OASValidator, Validator } from '@har-sdk/validator';
const doc = {
swagger: '2.0',
host: 'http://localhost:3000',
info: {
title: 'Some valid API document',
version: '1.0.0'
},
paths: {}
} as OpenAPIV2.Document;
const result = await new OASValidator().verify(doc);
console.log(result);
// {
// valid: false,
// errors: [
// {
// instancePath: '/info',
// schemaPath: '#/required',
// keyword: 'required',
// params: { missingProperty: 'version' },
// message: "must have required property 'version'"
// }
// ]
// }
After:
import { OpenAPIV2 } from '@har-sdk/types';
import { OASValidator, ErrorHumanizer } from '@har-sdk/validator';
const doc = {
swagger: '2.0',
host: 'localhost',
info: {
title: 'Some valid API document'
},
paths: {}
} as OpenAPIV2.Document;
const errors = await new OASValidator().verify(doc);
console.log(errors);
// [
// {
// instancePath: '/info',
// schemaPath: '#/required',
// keyword: 'required',
// params: { missingProperty: 'version' },
// message: "must have required property 'version'"
// }
// ]
Published by derevnjuk about 3 years ago
Published by derevnjuk about 3 years ago
Published by derevnjuk about 3 years ago
Published by derevnjuk about 3 years ago
Published by derevnjuk about 3 years ago
Published by derevnjuk over 3 years ago
Published by derevnjuk over 3 years ago
Published by derevnjuk over 3 years ago
Published by derevnjuk over 3 years ago
Published by derevnjuk over 3 years ago
Published by derevnjuk over 3 years ago