You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

autocomplete-openapi

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

autocomplete-openapi - npm Package Compare versions

Comparing version

to
0.1.2

src/request-docs.js

2

package.json
{
"name": "autocomplete-openapi",
"version": "0.1.1",
"version": "0.1.2",
"description": "Autocompletes different parts of an OpenAPI spec",

@@ -5,0 +5,0 @@ "main": "index.js",

export class OpenAPIMethod {
constructor(method, path, body) {
constructor(method, path, body, operationId, tags) {
this.method = method;
this.path = path;
this.body = body; // defiition of the body
this.body = body; // definition of the body
this.operationId=operationId;
this.tags=tags;
}

@@ -24,3 +26,5 @@ }

path,
this.openapi.paths[path][method]?.requestBody?.content?.['application/json']?.schema?.['$ref']
this.openapi.paths[path][method]?.requestBody?.content?.['application/json']?.schema?.['$ref'],
this.openapi.paths[path][method].operationId,
this.openapi.paths[path][method].tags
));

@@ -27,0 +31,0 @@ }

@@ -20,2 +20,11 @@ "use strict";

it("should extract all method definitions", () => {
let allMethods = new OpenAPIExtractor(openapi).getAllMethods();
for (const method of allMethods){
if (method.path == '/telemetry'){
assert.equal(method.tags[0], 'service')
}
}
})
it("should extract model object by ref", () => {

@@ -27,3 +36,2 @@ let objects = new OpenAPIExtractor(openapi).objectByRef("#/components/schemas/CreateCollection");

it("should extract model object by path", () => {

@@ -30,0 +38,0 @@ let objects = [];