Skip to content

Commit bb09a59

Browse files
committed
Fix __originalOperationId inconsistencies
1 parent 9bf0a22 commit bb09a59

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/helpers.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,14 +124,16 @@ export function normalizeSwagger(parsedSpec) {
124124
Object.keys(map).forEach((op) => {
125125
if (map[op].length > 1) {
126126
map[op].forEach((o, i) => {
127+
o.__originalOperationId = o.__originalOperationId || o.operationId
127128
o.operationId = `${op}${i+1}`
128129
})
129130
} else {
130131
// Ensure we always add the normalized operation ID if one already exists ( potentially different, given that we normalize our IDs)
131132
// ... _back_ to the spec. Otherwise, they might not line up
132133
if(typeof operation.operationId !== 'undefined') {
133-
operation.__originalOperationId = operation.operationId
134-
operation.operationId = op
134+
let obj = map[op][0]
135+
obj.__originalOperationId = obj.__originalOperationId || operation.operationId
136+
obj.operationId = op
135137
}
136138
}
137139

0 commit comments

Comments
 (0)