autocomplete-openapi
Advanced tools
Comparing version
{ | ||
"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
398187
37.72%13120
39.06%