Releases: NeuraLegion/har-sdk
Releases · NeuraLegion/har-sdk
@har-sdk/[email protected]
@har-sdk/validator 2.0.0 (2021-11-08)
BREAKING CHANGES
- The
verify
method has been reworked. In case of validation failure, the returned promise is resolved with an array ofErrorObject
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'"
// }
// ]
@har-sdk/[email protected]
@har-sdk/postman 2.0.0 (2021-11-08)
BREAKING CHANGES
- The
verify
method has been reworked. In case of validation failure, the returned promise is resolved with an array ofErrorObject
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'"
// }
// ]
Dependencies
- @har-sdk/validator: upgraded to 2.0.0
@har-sdk/[email protected]
@har-sdk/openapi-sampler 2.0.0 (2021-11-08)
BREAKING CHANGES
- The
verify
method has been reworked. In case of validation failure, the returned promise is resolved with an array ofErrorObject
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'"
// }
// ]
@har-sdk/[email protected]
@har-sdk/oas 2.0.0 (2021-11-08)
BREAKING CHANGES
- The
verify
method has been reworked. In case of validation failure, the returned promise is resolved with an array ofErrorObject
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'"
// }
// ]
Dependencies
- @har-sdk/openapi-sampler: upgraded to 2.0.0
- @har-sdk/validator: upgraded to 2.0.0