diff --git a/eng/tools/typespec-migration-validation/src/configuration.ts b/eng/tools/typespec-migration-validation/src/configuration.ts index 50e897923a51..43ffbb407599 100644 --- a/eng/tools/typespec-migration-validation/src/configuration.ts +++ b/eng/tools/typespec-migration-validation/src/configuration.ts @@ -7,5 +7,5 @@ interface configuration { export const configuration: configuration = { ignoreDescription: true, enumNameToCamelCase: true, - ignorePathCase: false, // Normalize the segments before provider + ignorePathCase: true, // Normalize the path }; diff --git a/eng/tools/typespec-migration-validation/src/document.ts b/eng/tools/typespec-migration-validation/src/document.ts index 64fae6ba7d91..b355219e236d 100644 --- a/eng/tools/typespec-migration-validation/src/document.ts +++ b/eng/tools/typespec-migration-validation/src/document.ts @@ -57,7 +57,13 @@ export function processDocument(document: OpenAPI2Document): OpenAPI2Document { if (configuration.ignorePathCase) { const normalizedRoute = route .replace(/\/resourcegroups\//i, "/resourceGroups/") - .replace(/\/subscriptions\//i, "/subscriptions/"); + .replace(/\/subscriptions\//i, "/subscriptions/") + .split('/') + .map(segment => { + if (segment.length === 0) return segment; + return segment.charAt(0).toLowerCase() + segment.slice(1); + }) + .join('/'); delete newDocument.paths[route]; newDocument.paths[normalizedRoute] = processedPath; } else { diff --git a/eng/tools/typespec-migration-validation/src/index.ts b/eng/tools/typespec-migration-validation/src/index.ts index db2fccaaeb68..02f85bdcd75d 100644 --- a/eng/tools/typespec-migration-validation/src/index.ts +++ b/eng/tools/typespec-migration-validation/src/index.ts @@ -202,7 +202,7 @@ export async function main() { const changedPaths = findChangedPaths(diffForFile); if (changedPaths.length > 0) { logWarning( - `Found ${changedPaths.length} changed paths in the diff. If it is just case change and you confirm it is expected, run tsmv with --ignorePathCase option to ignore case changes.`, + `Found ${changedPaths.length} changed paths in the diff.`, ); const changedPathsReport = formatChangedPathsReport(changedPaths); console.log(changedPathsReport);