MCPcopy Create free account
hub / github.com/dataease/SQLBot / normalize_operation_ids

Function normalize_operation_ids

frontend/public/swagger-ui-bundle.js:54588–54663  ·  view source on GitHub ↗
({
              storageField: s = 'x-normalized',
              operationIdNormalizer: o = normalizeOperationId,
            } = {})

Source from the content-addressed store, hash-verified

54586 )
54587 },
54588 normalize_operation_ids =
54589 ({
54590 storageField: s = 'x-normalized',
54591 operationIdNormalizer: o = normalizeOperationId,
54592 } = {}) =>
54593 (i) => {
54594 const { predicates: a, ancestorLineageToJSONPointer: u, namespace: _ } = i,
54595 w = [],
54596 x = [],
54597 C = []
54598 let j
54599 return {
54600 visitor: {
54601 OpenApi3_1Element: {
54602 enter(o) {
54603 j = new Px(o, s, 'operation-ids')
54604 },
54605 leave() {
54606 const s = jx((s) => serializers_value(s.operationId), x)
54607 ;(Object.entries(s).forEach(([s, o]) => {
54608 Array.isArray(o) &&
54609 (o.length <= 1 ||
54610 o.forEach((o, i) => {
54611 const a = `${s}${i + 1}`
54612 o.operationId = new _.elements.String(a)
54613 }))
54614 }),
54615 C.forEach((s) => {
54616 if (void 0 === s.operationId) return
54617 const o = String(serializers_value(s.operationId)),
54618 i = x.find(
54619 (s) => serializers_value(s.meta.get('originalOperationId')) === o
54620 )
54621 void 0 !== i &&
54622 ((s.operationId = cloneDeep.safe(i.operationId)),
54623 s.meta.set('originalOperationId', o),
54624 s.set('__originalOperationId', o))
54625 }),
54626 (x.length = 0),
54627 (C.length = 0),
54628 (j = void 0))
54629 },
54630 },
54631 PathItemElement: {
54632 enter(s) {
54633 const o = Na('path', serializers_value(s.meta.get('path')))
54634 w.push(o)
54635 },
54636 leave() {
54637 w.pop()
54638 },
54639 },
54640 OperationElement: {
54641 enter(s, i, a, C, L) {
54642 if (void 0 === s.operationId) return
54643 const B = u([...L, a, s])
54644 if (j.includes(B)) return
54645 const $ = String(serializers_value(s.operationId)),

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected