Skip to content

Commit

Permalink
test: add test case for not validating properties called security
Browse files Browse the repository at this point in the history
  • Loading branch information
dpopp07 committed Feb 4, 2019
1 parent 59f26b0 commit e89fe2e
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions test/plugins/validation/2and3/security-ibm.js
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,37 @@ describe('validation plugin - semantic - security-ibm', function() {
expect(res.errors.length).toEqual(0);
expect(res.warnings.length).toEqual(0);
});

it('should not validate an object property with the name "security"', function() {
const spec = {
paths: {
'CoolPath/secured': {
get: {
operationId: 'secureGet',
summary: 'secure get operation',
responses: {
default: {
description: 'test response',
schema: {
type: 'object',
properties: {
security: {
type: 'string',
description: 'just an innocent string'
}
}
}
}
}
}
}
}
};

const res = validate({ jsSpec: spec }, config);
expect(res.errors.length).toEqual(0);
expect(res.warnings.length).toEqual(0);
});
});

describe('OpenAPI 3', function() {
Expand Down

0 comments on commit e89fe2e

Please sign in to comment.