Function
uniquePathKey
(
paths: Record<string, Record<string, OpenApiOperationObject>>,
preferredPath: string,
method: string,
toolPath: string,
)
Source from the content-addressed store, hash-verified
| 406 | pathTemplate.includes(`{+${parameterName}}`); |
| 407 | |
| 408 | const uniquePathKey = ( |
| 409 | paths: Record<string, Record<string, OpenApiOperationObject>>, |
| 410 | preferredPath: string, |
| 411 | method: string, |
| 412 | toolPath: string, |
| 413 | ): string => { |
| 414 | if (!paths[preferredPath]?.[method]) return preferredPath; |
| 415 | const disambiguated = `/${toolPath.replace(/[^A-Za-z0-9._~-]+/g, "/")}`; |
| 416 | if (!paths[disambiguated]?.[method]) return disambiguated; |
| 417 | let index = 2; |
| 418 | while (paths[`${disambiguated}/${index}`]?.[method]) index += 1; |
| 419 | return `${disambiguated}/${index}`; |
| 420 | }; |
| 421 | |
| 422 | const discoveryDescription = (value: unknown): string | undefined => |
| 423 | typeof value === "string" |
Tested by
no test coverage detected