Skip to content

Commit 25b16b3

Browse files
committed
feat: classify path parameter name change as annotation
1 parent 5cec871 commit 25b16b3

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/openapi/openapi3.classify.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ export const parameterAllowReservedClassifyRule: ClassifyRule = [
7373
export const parameterNameClassifyRule: ClassifyRule = [
7474
nonBreaking,
7575
breaking,
76-
({ before }) => (getKeyValue(before.parent, 'in') === 'path' ? nonBreaking : breaking),
76+
({ before }) => (getKeyValue(before.parent, 'in') === 'path' ? annotation : breaking),
7777
]
7878

7979
export const parameterRequiredClassifyRule: ClassifyRule = [

test/openapi.diff.test.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -193,13 +193,13 @@ describe('Openapi3 operation changes', () => {
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
})
@@ -217,13 +217,13 @@ describe('Openapi3 operation changes', () => {
217217
action: DiffAction.replace,
218218
beforeDeclarationPaths: [['paths', '/path1/{param1}/{anotherParam1}', 'get', 'parameters', 0, 'name']],
219219
afterDeclarationPaths: [['paths', '/path1/{param2}/{anotherParam2}', 'get', 'parameters', 1, 'name']],
220-
type: nonBreaking,
220+
type: annotation,
221221
}),
222222
expect.objectContaining({
223223
action: DiffAction.replace,
224224
beforeDeclarationPaths: [['paths', '/path1/{param1}/{anotherParam1}', 'get', 'parameters', 1, 'name']],
225225
afterDeclarationPaths: [['paths', '/path1/{param2}/{anotherParam2}', 'get', 'parameters', 0, 'name']],
226-
type: nonBreaking,
226+
type: annotation,
227227
}),
228228
]))
229229
})
@@ -258,7 +258,7 @@ describe('Openapi3 operation changes', () => {
258258
action: DiffAction.replace,
259259
beforeDeclarationPaths: [['paths', '/path1/{param1}', 'get', 'parameters', 0, 'name']],
260260
afterDeclarationPaths: [['paths', '/path1/{param2}', 'get', 'parameters', 0, 'name']],
261-
type: nonBreaking,
261+
type: annotation,
262262
}),
263263
expect.objectContaining({
264264
action: DiffAction.add,

0 commit comments

Comments
 (0)