Gathering detailed insights and metrics for @har-sdk/oas
Gathering detailed insights and metrics for @har-sdk/oas
Gathering detailed insights and metrics for @har-sdk/oas
Gathering detailed insights and metrics for @har-sdk/oas
@har-sdk/core
The base package can be used to import specification files (i.e. HAR, OAS and Postman Collection) and detect their type.
@har-sdk/openapi-sampler
[](https://codeclimate.com/github/NeuraLegion/har-sdk/maintainability) [ PACKAGE**
HAR SDK enables Node.js developers to easily work with HAR, convert it from OAS/Swagger and Postman collection, and more.
npm install @har-sdk/oas
Typescript
Module System
Node Version
NPM Version
@har-sdk/oas@2.12.2
Updated on Apr 03, 2025
@har-sdk/openapi-sampler@2.4.2
Updated on Apr 03, 2025
@har-sdk/editor@1.5.14
Updated on Mar 25, 2025
@har-sdk/validator@2.6.1
Updated on Mar 25, 2025
@har-sdk/types@1.1.10
Updated on Mar 25, 2025
@har-sdk/postman@2.4.7
Updated on Mar 25, 2025
TypeScript (98.24%)
JavaScript (1.72%)
Shell (0.04%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
11 Stars
157 Commits
5 Forks
15 Watchers
7 Branches
26 Contributors
Updated on Apr 03, 2025
Latest Version
2.12.2
Package Id
@har-sdk/oas@2.12.2
Unpacked Size
294.86 kB
Size
72.44 kB
File Count
195
NPM Version
10.8.2
Node Version
18.20.7
Published on
Apr 03, 2025
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
Transform your Swagger/OAS spec files into a series of HAR request objects.
With this library, you can easily generate requests with fake data to test your API using AutoCannon or DevTools.
To install the library, run the following command:
1$ npm i --save @har-sdk/oas
To covert your specification, use the oas2har
function as follows:
1import schema from './swagger.json' assert { type: 'json' }; 2import { oas2har } from '@har-sdk/oas'; 3 4const requests = await oas2har(schema); 5console.log(requests);
YAML files can also be loaded using js-yaml, as shown below:
1import { oas2har } from '@har-sdk/oas'; 2import { readFile } from 'node:fs/promises'; 3import yaml from 'js-yaml'; 4 5const content = yaml.load(await readFile('./swagger.yaml', 'utf-8')); 6const requests = await oas2har(content); 7console.log(requests);
If you have your specification hosted remotely, you can use a library like axios to fetch it and then convert it to a HAR. Here's an example:
1import axios from 'axios'; 2import { oas2har } from '@har-sdk/oas'; 3 4const url = 'https://example.com/swagger.json'; 5const response = await axios.get(url); 6const requests = await oas2har(response.data); 7console.log(requests);
Some specifications may incorporate example values for parameters provided in vendor extension fields, to include such examples in output use the oas2har
function as follows:
1import schema from './swagger.json' assert { type: 'json' }; 2import { oas2har } from '@har-sdk/oas'; 3 4const requests = await oas2har(schema, { includeVendorExamples: true }); 5console.log(requests);
Notice the includeVendorExamples
option affects Swagger specifications only.
Some specifications may have configuration for Accept
header value in request parameters section. The automatically inferred Accept
header values may be skipped, to skip these inferred values in output use the oas2har
function as follows:
1import schema from './swagger.json' assert { type: 'json' }; 2import { oas2har } from '@har-sdk/oas'; 3 4const requests = await oas2har(schema, { skipAcceptHeaderInference: true }); 5console.log(requests);
Copyright © 2023 Bright Security.
This project is licensed under the MIT License - see the LICENSE file for details.
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
all changesets reviewed
Reason
license file detected
Details
Reason
no binaries found in the repo
Reason
dependency not pinned by hash detected -- score normalized to 5
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
16 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-07-14
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More