Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildClassificationPath ¶
func BuildClassificationPath(project string, includesScope bool, scopeName string, raw string) (string, error)
BuildClassificationPath prepares the path segment for Azure DevOps REST endpoints.
Rules and validations: - Accepts user input with either forward or backward slashes. - Uses the same normalization rules as NormalizeClassificationPath. - If the trimmed input is empty, returns ("", nil) to indicate "no path" (keeps existing callers behavior). - Removes a leading project segment (case-insensitive) if present. - If includesScope is true, removes a leading scopeName segment (case-insensitive) if present after project removal. - Rejects input that would produce empty segments (e.g., "a//b" after normalization should not happen because we collapse slashes). - Trims whitespace around each segment. - URL-escapes each segment with url.PathEscape and joins with forward slashes.
func NormalizeClassificationPath ¶
NormalizeClassificationPath normalizes classification node paths.
Behavior: - If raw is empty or only whitespace/slashes, returns an empty string. - Converts backslashes to forward slashes. - Trims surrounding whitespace. - Collapses consecutive slashes (e.g. "a//b" -> "a/b"). - Removes any leading and trailing slashes. Examples:
NormalizeClassificationPath(" \\Project\\Area\\Foo\\ ") -> "Project/Area/Foo"
NormalizeClassificationPath("/a//b/") -> "a/b"
Types ¶
This section is empty.