Skip to content
This repository has been archived by the owner on Dec 5, 2022. It is now read-only.

Commit

Permalink
fix(swagger-to-html): fix additional properties
Browse files Browse the repository at this point in the history
  • Loading branch information
bhaskarmelkani committed Sep 1, 2017
1 parent d824382 commit 7c0b886
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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});
Expand Down
2 changes: 0 additions & 2 deletions lib/nodejs/swagger-parser/lib/processItems/object.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 || {};
Expand Down

0 comments on commit 7c0b886

Please # to comment.