-
-
Notifications
You must be signed in to change notification settings - Fork 240
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: SL-1709 Paths consistency (#90)
* fix: a typo and a probable cut-and-paste error src/rulesets/oas3/index.ts and associated tests: 'specifcication' -> 'specification' in a comment `servers` must be, and is tested against, being an array not a string * fix: allow path-keys-no-trailing-slash empty slash (#85) * fix: add operation-operationId-valid-in-url (#86) to check for valid url characters in operationId * fix: SL-1709 paths emitted by ajv are not json pointers * fix: SL-1709 fixed json dependency version
- Loading branch information
1 parent
fe86612
commit c88ca75
Showing
4 changed files
with
61 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import { Spectral } from '../../../spectral'; | ||
import { oas2Rules } from '../index'; | ||
|
||
const ruleset = { rules: oas2Rules() }; | ||
|
||
describe('oas2-schema', () => { | ||
const s = new Spectral(); | ||
s.addRules({ | ||
'oas2-schema': Object.assign(ruleset.rules['oas2-schema'], { | ||
enabled: true, | ||
}), | ||
}); | ||
|
||
test('annotates with correct paths', () => { | ||
const results = s.run({ | ||
swagger: '2.0', | ||
paths: { | ||
'/test': { | ||
get: {}, | ||
}, | ||
}, | ||
schemes: ['http'], | ||
info: { | ||
title: 'Test', | ||
version: '1.0.0', | ||
}, | ||
}); | ||
expect(results.results).toHaveLength(1); | ||
expect(results.results[0].path).toEqual(['paths', '/test', 'get']); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters