Skip to content

Commit 8b28d67

Browse files
SamerJaser96dpopp07
authored andcommitted
fix: remove support for links in swagger2 (#76)
`links` are only supported in openapi 3
1 parent 093ffbf commit 8b28d67

File tree

2 files changed

+2
-3
lines changed
  • src/plugins/validation/2and3/semantic-validators
  • test/plugins/validation/2and3

2 files changed

+2
-3
lines changed

src/plugins/validation/2and3/semantic-validators/walker.js

-1
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,6 @@ module.exports.validate = function({ jsSpec, isOAS3 }, config) {
127127
// values are globs!
128128
const unacceptableRefPatternsS2 = {
129129
responses: ['!*#/responses*'],
130-
links: ['!*#/links*'],
131130
schema: ['!*#/definitions*'],
132131
parameters: ['!*#/parameters*']
133132
};

test/plugins/validation/2and3/walker.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -633,7 +633,7 @@ describe('validation plugin - semantic - spec walker', () => {
633633
}
634634
};
635635

636-
const res = validate({ jsSpec: spec }, config);
636+
const res = validate({ jsSpec: spec, isOAS3: true }, config);
637637
expect(res.errors.length).toEqual(0);
638638
expect(res.warnings.length).toEqual(1);
639639
expect(res.warnings[0].path).toEqual([
@@ -646,7 +646,7 @@ describe('validation plugin - semantic - spec walker', () => {
646646
'$ref'
647647
]);
648648
expect(res.warnings[0].message).toEqual(
649-
'links $refs must follow this format: *#/links*'
649+
'links $refs must follow this format: *#/components/links*'
650650
);
651651
});
652652
});

0 commit comments

Comments
 (0)