Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
interface configuration {
ignoreDescription: boolean;
enumNameToCamelCase: boolean;
Expand All @@ -7,5 +7,5 @@
export const configuration: configuration = {
ignoreDescription: true,
enumNameToCamelCase: true,
ignorePathCase: false, // Normalize the segments before provider
ignorePathCase: true, // Normalize the path
};
8 changes: 7 additions & 1 deletion eng/tools/typespec-migration-validation/src/document.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import {
OpenAPI2Document,
OpenAPI2PathItem,
Expand Down Expand Up @@ -57,7 +57,13 @@
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 {
Expand Down
2 changes: 1 addition & 1 deletion eng/tools/typespec-migration-validation/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import { sortOpenAPIDocument } from "@azure-tools/typespec-autorest";
import fs from "fs";
import { diff } from "json-diff";
Expand Down Expand Up @@ -202,7 +202,7 @@
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);
Expand Down
Loading