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.4

2

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

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

@@ -72,3 +72,3 @@ export class OpenAPIMethod {

}
if (option?.["type"] === "object") {
if (option?.["type"] === "object" || option?.["type"] === "array") {
result.push(...this._objectsByPath(option, path));

@@ -75,0 +75,0 @@ }

@@ -35,2 +35,13 @@ "use strict";

it("filter completion", () => {
let openapiExtractor = new OpenAPIExtractor(openapi);
let objects1 = [];
let objects2 = [];
objects1 = openapiExtractor.objectsByPath("#/components/schemas/Filter", ["must", 0, "match"]);
objects2 = openapiExtractor.objectsByPath("#/components/schemas/Filter", ["must", "match"]);
assert.deepEqual(objects1, objects2);
});
it("should extract model object by path", () => {

@@ -41,3 +52,3 @@ let objects = [];

objects = openapiExtractor.objectsByPath("#/components/schemas/CreateCollection", ["vectors", "image", "quantization_config"]);
assert.equal(objects.length, 2); // scalar and product
assert.equal(objects.length, 3); // scalar, product, binary

@@ -48,3 +59,3 @@ objects = openapiExtractor.objectsByPath("#/components/schemas/CreateCollection", ["optimizers_config"]);

objects = openapiExtractor.objectsByPath("#/components/schemas/CreateCollection", ["vectors", "quantization_config"]);
assert.equal(objects.length, 3); // scalar, product or VectorParams (quantization_config might be a name of a field)
assert.equal(objects.length, 4); // scalar, product, binary or VectorParams (quantization_config might be a name of a field)

@@ -51,0 +62,0 @@ objects = openapiExtractor.objectsByPath("#/components/schemas/CreateCollection", ["vectors", "quantization_config", "scalar"]);

Sorry, the diff of this file is too big to display