File tree Expand file tree Collapse file tree 2 files changed +54
-0
lines changed
projects/prefix-groups/change-path-param-name Expand file tree Collapse file tree 2 files changed +54
-0
lines changed Original file line number Diff line number Diff line change @@ -263,6 +263,25 @@ describe('Prefix Groups test', () => {
263263 ] ) )
264264 } )
265265
266+ test ( 'Change path parameter name in a new version' , async ( ) => {
267+ const result = await buildPrefixGroupChangelogPackage ( { packageId : 'prefix-groups/change-path-param-name' } )
268+
269+ expect ( result ) . toEqual ( changesSummaryMatcher ( {
270+ [ ANNOTATION_CHANGE_TYPE ] : 2 ,
271+ } ) )
272+ expect ( result ) . toEqual ( numberOfImpactedOperationsMatcher ( {
273+ [ ANNOTATION_CHANGE_TYPE ] : 1 ,
274+ } ) )
275+
276+ //check operation ids
277+ expect ( result ) . toEqual ( operationChangesMatcher ( [
278+ expect . objectContaining ( {
279+ operationId : 'users-id-posts-get' ,
280+ previousOperationId : 'users-userid-posts-get' ,
281+ } ) ,
282+ ] ) )
283+ } )
284+
266285 test ( 'should compare prefix groups with different length' , async ( ) => {
267286 const result = await buildPrefixGroupChangelogPackage ( {
268287 packageId : 'prefix-groups/different-prefix-length' ,
Original file line number Diff line number Diff line change 1+ openapi : 3.0.3
2+ info :
3+ title : test
4+ version : 0.1.0
5+ paths :
6+ /api/v1/users/{userId}/posts :
7+ get :
8+ operationId : getUserPosts
9+ parameters :
10+ - name : userId
11+ in : path
12+ required : true
13+ schema :
14+ type : string
15+ responses :
16+ ' 200 ' :
17+ description : OK
18+ content :
19+ application/json :
20+ schema : {}
21+ /api/v2/users/{id}/posts :
22+ get :
23+ operationId : getUserPosts
24+ parameters :
25+ - name : id
26+ in : path
27+ required : true
28+ schema :
29+ type : string
30+ responses :
31+ ' 200 ' :
32+ description : OK
33+ content :
34+ application/json :
35+ schema : {}
You can’t perform that action at this time.
0 commit comments