
Security News
Vite+ Joins the Push to Consolidate JavaScript Tooling
Evan You announces Vite+, a commercial, Rust-powered toolchain built on the Vite ecosystem to unify JavaScript development and fund open source.
@har-sdk/validator
Advanced tools
A validator for HAR v1.2 Spec, OpenAPI and Postman documents.
npm i --save @har-sdk/validator
import { OpenAPIV2 } from '@har-sdk/types';
import { OASValidator, ErrorHumanizer } from '@har-sdk/validator';
const apiDoc = {
swagger: '2.0',
host: 'localhost',
info: {
title: 'Some valid API document'
},
paths: {}
} as OpenAPIV2.Document;
const errors = await new OASValidator().verify(apiDoc as any);
console.log(errors);
// [
// {
// "instancePath": "/info",
// "schemaPath": "#/required",
// "keyword": "required",
// "params": {
// "missingProperty": "version"
// },
// "message": "must have required property 'version'"
// }
// ]
const humanizedErrors = await new ErrorHumanizer().humanizeErrors(errors);
console.log(humanizedErrors);
// [
// {
// "originalError": {
// "instancePath": "/info",
// "schemaPath": "#/required",
// "keyword": "required",
// "params": {
// "missingProperty": "version"
// },
// "message": "must have required property 'version'"
// },
// "message": "the value at /info is missing the required field `version`",
// "messageParts": [
// {
// "text": "the value at /info",
// "jsonPointer": "/info"
// },
// {
// "text": "is missing the required field `version`"
// }
// ]
// }
// ]
See Error Object
FAQs
A validator for HAR v1.2 Spec, OpenAPI and Postman documents.
The npm package @har-sdk/validator receives a total of 275 weekly downloads. As such, @har-sdk/validator popularity was classified as not popular.
We found that @har-sdk/validator demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Evan You announces Vite+, a commercial, Rust-powered toolchain built on the Vite ecosystem to unify JavaScript development and fund open source.
Security News
Ruby Central’s incident report on the RubyGems.org access dispute sparks backlash from former maintainers and renewed debate over project governance.
Research
/Security News
Socket researchers uncover how threat actors weaponize Discord across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.