diff --git a/package.json b/package.json index bd4c87f10..d1b3388e3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "swagger-client", - "version": "3.4.0", + "version": "3.4.1", "description": "SwaggerJS - a collection of interfaces for OAI specs", "main": "dist/index.js", "repository": "git@github.com:swagger-api/swagger-js.git", diff --git a/src/specmap/index.js b/src/specmap/index.js index cb7a64631..0632938ec 100644 --- a/src/specmap/index.js +++ b/src/specmap/index.js @@ -83,8 +83,6 @@ class SpecMap { // We might consider making this (traversing & application) configurable later. function createKeyBasedPlugin(pluginObj) { return function* (patches, specmap) { - const resultCache = {} - for (const patch of patches.filter(lib.isAdditiveMutation)) { yield* traverse(patch.value, patch.path, patch) } @@ -104,29 +102,13 @@ class SpecMap { for (const key of Object.keys(obj)) { const val = obj[key] const updatedPath = path.concat(key) - const isObj = lib.isObject(val) - - // If the object has a meta '$$ref' - and store this $$ref - // in a lookaside to prevent future traversals of this $ref's tree. - const objRef = obj.$$ref - if (isObj) { - // console.log('recursive case', {obj, path, patch}) + if (lib.isObject(val)) { yield* traverse(val, updatedPath, patch) } if (!isRootProperties && key === pluginObj.key) { - // console.log('base case', {obj, path, patch}) - const stringifiedPath = path.join('/') - - if (resultCache[stringifiedPath]) { - yield resultCache[stringifiedPath] - } - else { - const res = pluginObj.plugin(val, key, updatedPath, specmap, patch) - resultCache[stringifiedPath] = res - yield res - } + yield pluginObj.plugin(val, key, updatedPath, specmap, patch) } } } diff --git a/test/resolver.js b/test/resolver.js index e2ee5fbf0..c86dab181 100644 --- a/test/resolver.js +++ b/test/resolver.js @@ -294,7 +294,7 @@ describe('resolver', () => { } } - describe.only('Swagger usage', function () { + describe('Swagger usage', function () { it.skip('should be able to resolve a Swagger document with $refs', () => { // When return Swagger.resolve({spec: DOCUMENT_ORIGINAL, allowMetaPatches: false})