77 DIFF_META_KEY ,
88 DiffAction ,
99 nonBreaking ,
10+ annotation ,
1011} from '../src'
1112
1213import { OpenapiBuilder , TEST_DIFF_FLAG , TEST_ORIGINS_FLAG , TEST_SYNTHETIC_TITLE_FLAG } from './helper'
@@ -186,20 +187,19 @@ describe('Openapi3 operation changes', () => {
186187 action : DiffAction . rename ,
187188 beforeDeclarationPaths : [ [ 'paths' , '/path1/{param1}/{anotherParam1}' ] ] ,
188189 afterDeclarationPaths : [ [ 'paths' , '/path1/{param2}/{anotherParam2}' ] ] ,
189- // todo fix
190- type : breaking ,
190+ type : annotation , // Only parameter names changed, unified paths are the same
191191 } ) ,
192192 expect . objectContaining ( {
193193 action : DiffAction . replace ,
194194 beforeDeclarationPaths : [ [ 'paths' , '/path1/{param1}/{anotherParam1}' , 'parameters' , 0 , 'name' ] ] ,
195195 afterDeclarationPaths : [ [ 'paths' , '/path1/{param2}/{anotherParam2}' , 'parameters' , 1 , 'name' ] ] ,
196- type : nonBreaking ,
196+ type : annotation ,
197197 } ) ,
198198 expect . objectContaining ( {
199199 action : DiffAction . replace ,
200200 beforeDeclarationPaths : [ [ 'paths' , '/path1/{param1}/{anotherParam1}' , 'parameters' , 1 , 'name' ] ] ,
201201 afterDeclarationPaths : [ [ 'paths' , '/path1/{param2}/{anotherParam2}' , 'parameters' , 0 , 'name' ] ] ,
202- type : nonBreaking ,
202+ type : annotation ,
203203 } ) ,
204204 ] ) )
205205 } )
@@ -211,20 +211,19 @@ describe('Openapi3 operation changes', () => {
211211 action : DiffAction . rename ,
212212 beforeDeclarationPaths : [ [ 'paths' , '/path1/{param1}/{anotherParam1}' ] ] ,
213213 afterDeclarationPaths : [ [ 'paths' , '/path1/{param2}/{anotherParam2}' ] ] ,
214- // todo fix
215- type : breaking ,
214+ type : annotation , // Only parameter names changed, unified paths are the same
216215 } ) ,
217216 expect . objectContaining ( {
218217 action : DiffAction . replace ,
219218 beforeDeclarationPaths : [ [ 'paths' , '/path1/{param1}/{anotherParam1}' , 'get' , 'parameters' , 0 , 'name' ] ] ,
220219 afterDeclarationPaths : [ [ 'paths' , '/path1/{param2}/{anotherParam2}' , 'get' , 'parameters' , 1 , 'name' ] ] ,
221- type : nonBreaking ,
220+ type : annotation ,
222221 } ) ,
223222 expect . objectContaining ( {
224223 action : DiffAction . replace ,
225224 beforeDeclarationPaths : [ [ 'paths' , '/path1/{param1}/{anotherParam1}' , 'get' , 'parameters' , 1 , 'name' ] ] ,
226225 afterDeclarationPaths : [ [ 'paths' , '/path1/{param2}/{anotherParam2}' , 'get' , 'parameters' , 0 , 'name' ] ] ,
227- type : nonBreaking ,
226+ type : annotation ,
228227 } ) ,
229228 ] ) )
230229 } )
@@ -253,14 +252,13 @@ describe('Openapi3 operation changes', () => {
253252 action : DiffAction . rename ,
254253 beforeDeclarationPaths : [ [ 'paths' , '/path1/{param1}' ] ] ,
255254 afterDeclarationPaths : [ [ 'paths' , '/path1/{param2}' ] ] ,
256- // todo fix
257- type : breaking ,
255+ type : annotation , // Only parameter name changed, unified paths are the same
258256 } ) ,
259257 expect . objectContaining ( {
260258 action : DiffAction . replace ,
261259 beforeDeclarationPaths : [ [ 'paths' , '/path1/{param1}' , 'get' , 'parameters' , 0 , 'name' ] ] ,
262260 afterDeclarationPaths : [ [ 'paths' , '/path1/{param2}' , 'get' , 'parameters' , 0 , 'name' ] ] ,
263- type : nonBreaking ,
261+ type : annotation ,
264262 } ) ,
265263 expect . objectContaining ( {
266264 action : DiffAction . add ,
0 commit comments