From 7c0b886f1deb5b789a4c665e2d334ca1a090ba5e Mon Sep 17 00:00:00 2001 From: bmelkani Date: Fri, 1 Sep 2017 16:28:59 +0200 Subject: [PATCH] fix(swagger-to-html): fix additional properties --- .../swagger-parser/__tests__/lib/processItems/object.test.js | 3 +-- lib/nodejs/swagger-parser/lib/processItems/object.js | 2 -- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/lib/nodejs/swagger-parser/__tests__/lib/processItems/object.test.js b/lib/nodejs/swagger-parser/__tests__/lib/processItems/object.test.js index 85775d3..63e573a 100644 --- a/lib/nodejs/swagger-parser/__tests__/lib/processItems/object.test.js +++ b/lib/nodejs/swagger-parser/__tests__/lib/processItems/object.test.js @@ -72,9 +72,8 @@ describe('swagger-parser.lib.processItems.object', () => { processObject({object, key, isRequired, result}); - expect(mockUpdateResult).toHaveBeenCalledTimes(2); + expect(mockUpdateResult).toHaveBeenCalled(); expect(mockUpdateResult).toHaveBeenCalledWith({object, key, isRequired, result}); - expect(mockUpdateResult).toHaveBeenCalledWith({object: object.additionalProperties, key, isRequired}); expect(mockTraverse).toHaveBeenCalledTimes(1); expect(mockTraverse).toHaveBeenCalledWith({object: {type: 'string'} , key: 'foo', isRequired: true}); diff --git a/lib/nodejs/swagger-parser/lib/processItems/object.js b/lib/nodejs/swagger-parser/lib/processItems/object.js index 7158183..fc402a7 100644 --- a/lib/nodejs/swagger-parser/lib/processItems/object.js +++ b/lib/nodejs/swagger-parser/lib/processItems/object.js @@ -7,10 +7,8 @@ const processObject = ({object, key, isRequired, result}) => { updateResult({object, key, isRequired, result}); // Check for additional properteis - // FIXME:: Check the representation of additionalProperties if (object.additionalProperties){ object = object.additionalProperties; - updateResult({object, key, isRequired}); } const properties = object.properties || {};