Socket
Socket
Sign inDemoInstall

openapi-snippet

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

openapi-snippet - npm Package Compare versions

Comparing version 0.9.0 to 0.9.1

17

openapi-to-har.js

@@ -43,3 +43,3 @@ /**

method: method.toUpperCase(),
url: baseUrl + getFullPath(openApi, path),
url: baseUrl + getFullPath(openApi, path, method),
headers: getHeadersArray(openApi, path, method),

@@ -89,2 +89,7 @@ queryString: getQueryStrings(openApi, path, method, queryParamValues),

}
if (openApi.paths[path][method].requestBody && openApi.paths[path][method].requestBody['$ref']) {
openApi.paths[path][method].requestBody = resolveRef(openApi, openApi.paths[path][method].requestBody['$ref']);
}
if (openApi.paths[path][method].requestBody && openApi.paths[path][method].requestBody.content &&

@@ -186,10 +191,12 @@ openApi.paths[path][method].requestBody.content['application/json'] &&

* @param {string} path Key of the path
* @param {string} method Key of the method
* @return {string} Full path including example values
*/
const getFullPath = function (openApi, path) {
const getFullPath = function (openApi, path, method) {
let fullPath = path
const parameters = openApi.paths[path].parameters || openApi.paths[path][method].parameters;
if (typeof openApi.paths[path].parameters !== 'undefined') {
for (let i in openApi.paths[path].parameters) {
let param = openApi.paths[path].parameters[i]
if (typeof parameters !== 'undefined') {
for (let i in parameters) {
let param = parameters[i]
if (typeof param['$ref'] === 'string' &&

@@ -196,0 +203,0 @@ /^#/.test(param['$ref'])) {

{
"name": "openapi-snippet",
"version": "0.9.0",
"version": "0.9.1",
"description": "Generates code snippets from Open API (previously Swagger) documents.",

@@ -5,0 +5,0 @@ "repository": {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc