Skip to content

Commit c0e0b9f

Browse files
authored
Merge pull request #1279 from shockey/bug/1276-prevent-equivalent-paths-regression
Add test to prevent regression from 2.x path templating errors issue
2 parents d0f2483 + 0118949 commit c0e0b9f

File tree

1 file changed

+29
-0
lines changed
  • test/plugins/validation/semantic

1 file changed

+29
-0
lines changed

test/plugins/validation/semantic/paths.js

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,35 @@ describe("validation plugin - semantic - paths", function(){
220220
expect(res.warnings).toEqual([])
221221
})
222222

223+
it("should return no problems for a templated and double-templated set of path strings", function(){
224+
const spec = {
225+
paths: {
226+
"/CoolPath/{group_id}/all": {
227+
parameters: [{
228+
name: "group_id",
229+
in: "path"
230+
}]
231+
},
232+
"/CoolPath/{group_id}/{user_id}": {
233+
parameters: [
234+
{
235+
name: "group_id",
236+
in: "path"
237+
},
238+
{
239+
name: "user_id",
240+
in: "path"
241+
},
242+
]
243+
},
244+
}
245+
}
246+
247+
let res = validate({ resolvedSpec: spec })
248+
expect(res.errors).toEqual([])
249+
expect(res.warnings).toEqual([])
250+
})
251+
223252
})
224253

225254
describe("Paths must have unique name + in parameters", () => {

0 commit comments

Comments
 (0)