@Test public void removes_regex_path_from_path() { assertThat(sanitize("/api/boring/{parameterized : ([a-zA-Z0-9])+}/path")) .isEqualTo("/api/boring/{parameterized}/path"); }
public static String sanitize(String path) { int colonPosition = path.indexOf(':'); if (colonPosition == -1) { return path; } int closingBracePosition = colonPosition + path.substring(colonPosition).indexOf('}'); return path.substring(0, colonPosition).trim() + sanitize(path.substring(closingBracePosition)); }
ApiPaths { public static String sanitize(String path) { int colonPosition = path.indexOf(':'); if (colonPosition == -1) { return path; } int closingBracePosition = colonPosition + path.substring(colonPosition).indexOf('}'); return path.substring(0, colonPosition).trim() + sanitize(path.substring(closingBracePosition)); } }
ApiPaths { public static String sanitize(String path) { int colonPosition = path.indexOf(':'); if (colonPosition == -1) { return path; } int closingBracePosition = colonPosition + path.substring(colonPosition).indexOf('}'); return path.substring(0, colonPosition).trim() + sanitize(path.substring(closingBracePosition)); }  }
ApiPaths { public static String sanitize(String path) { int colonPosition = path.indexOf(':'); if (colonPosition == -1) { return path; } int closingBracePosition = colonPosition + path.substring(colonPosition).indexOf('}'); return path.substring(0, colonPosition).trim() + sanitize(path.substring(closingBracePosition)); }  static String sanitize(String path); static Collection<PathParameter> decorate(Collection<PathParameter> pathParameters, String path); }
ApiPaths { public static String sanitize(String path) { int colonPosition = path.indexOf(':'); if (colonPosition == -1) { return path; } int closingBracePosition = colonPosition + path.substring(colonPosition).indexOf('}'); return path.substring(0, colonPosition).trim() + sanitize(path.substring(closingBracePosition)); }  static String sanitize(String path); static Collection<PathParameter> decorate(Collection<PathParameter> pathParameters, String path);  }