You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/Service.Tests/UnitTests/ConfigValidationUnitTests.cs
+20-10Lines changed: 20 additions & 10 deletions
Original file line number
Diff line number
Diff line change
@@ -2066,21 +2066,31 @@ public void ValidateRestMethodsForEntityInConfig(
2066
2066
[DataTestMethod]
2067
2067
[DataRow(true,"EntityA","",true,"The rest path for entity: EntityA cannot be empty.",
2068
2068
DisplayName="Empty rest path configured for an entity fails config validation.")]
2069
-
[DataRow(true,"EntityA","entity?RestPath",true,"The rest path: entity?RestPath for entity: EntityA contains one or more reserved characters.",
2069
+
[DataRow(true,"EntityA","entity?RestPath",true,"The rest path: entity?RestPath for entity: EntityA contains '?' which is reserved for query strings in URLs.",
2070
2070
DisplayName="Rest path for an entity containing reserved character ? fails config validation.")]
2071
-
[DataRow(true,"EntityA","entity#RestPath",true,"The rest path: entity#RestPath for entity: EntityA contains one or more reserved characters.",
2072
-
DisplayName="Rest path for an entity containing reserved character ? fails config validation.")]
2073
-
[DataRow(true,"EntityA","entity[]RestPath",true,"The rest path: entity[]RestPath for entity: EntityA contains one or more reserved characters.",
2074
-
DisplayName="Rest path for an entity containing reserved character ? fails config validation.")]
2075
-
[DataRow(true,"EntityA","entity+Rest*Path",true,"The rest path: entity+Rest*Path for entity: EntityA contains one or more reserved characters.",
2076
-
DisplayName="Rest path for an entity containing reserved character ? fails config validation.")]
2077
-
[DataRow(true,"Entity?A",null,true,"The rest path: Entity?A for entity: Entity?A contains one or more reserved characters.",
2071
+
[DataRow(true,"EntityA","entity#RestPath",true,"The rest path: entity#RestPath for entity: EntityA contains '#' which is reserved for URL fragments.",
2072
+
DisplayName="Rest path for an entity containing reserved character # fails config validation.")]
2073
+
[DataRow(true,"EntityA","entity[]RestPath",true,"The rest path: entity[]RestPath for entity: EntityA contains characters that are not allowed in URL paths. Valid paths contain only alphanumeric characters, hyphens (-), and underscores (_), with forward slashes (/) as path separators.",
2074
+
DisplayName="Rest path for an entity containing reserved character [] fails config validation.")]
2075
+
[DataRow(true,"EntityA","entity+Rest*Path",true,"The rest path: entity+Rest*Path for entity: EntityA contains characters that are not allowed in URL paths. Valid paths contain only alphanumeric characters, hyphens (-), and underscores (_), with forward slashes (/) as path separators.",
2076
+
DisplayName="Rest path for an entity containing reserved character +* fails config validation.")]
2077
+
[DataRow(true,"Entity?A",null,true,"The rest path: Entity?A for entity: Entity?A contains '?' which is reserved for query strings in URLs.",
2078
2078
DisplayName="Entity name for an entity containing reserved character ? fails config validation.")]
2079
-
[DataRow(true,"Entity&*[]A",null,true,"The rest path: Entity&*[]A for entity: Entity&*[]A contains one or more reserved characters.",
2080
-
DisplayName="Entity name containing reserved character ? fails config validation.")]
2079
+
[DataRow(true,"Entity&*[]A",null,true,"The rest path: Entity&*[]A for entity: Entity&*[]A contains characters that are not allowed in URL paths. Valid paths contain only alphanumeric characters, hyphens (-), and underscores (_), with forward slashes (/) as path separators.",
2080
+
DisplayName="Entity name containing reserved character &*[] fails config validation.")]
2081
2081
[DataRow(false,"EntityA","entityRestPath",true,DisplayName="Rest path correctly configured as a non-empty string without any reserved characters.")]
DisplayName="Rest path with sub-directory passes config validation.")]
2086
+
[DataRow(false,"EntityA","api/v1/books",true,
2087
+
DisplayName="Rest path with multiple sub-directories passes config validation.")]
2088
+
[DataRow(true,"EntityA","entity\\path",true,"The rest path: entity\\path for entity: EntityA contains a backslash (\\). Use forward slash (/) for path separators.",
2089
+
DisplayName="Rest path with backslash fails config validation with helpful message.")]
2090
+
[DataRow(false,"EntityA","/entity/path",true,
2091
+
DisplayName="Rest path with leading slash is trimmed and passes config validation.")]
2092
+
[DataRow(true,"EntityA","entity//path",true,"The rest path: entity//path for entity: EntityA contains empty path segments. Ensure there are no leading, consecutive, or trailing slashes.",
2093
+
DisplayName="Rest path with consecutive slashes fails config validation.")]
0 commit comments