(
path: str,
param_convertors: dict[str, Convertor[Any]],
path_params: dict[str, str],
)
| 90 | |
| 91 | |
| 92 | def replace_params( |
| 93 | path: str, |
| 94 | param_convertors: dict[str, Convertor[Any]], |
| 95 | path_params: dict[str, str], |
| 96 | ) -> tuple[str, dict[str, str]]: |
| 97 | for key, value in list(path_params.items()): |
| 98 | if "{" + key + "}" in path: |
| 99 | convertor = param_convertors[key] |
| 100 | value = convertor.to_string(value) |
| 101 | path = path.replace("{" + key + "}", value) |
| 102 | path_params.pop(key) |
| 103 | return path, path_params |
| 104 | |
| 105 | |
| 106 | # Match parameters in URL paths, eg. '{param}', and '{param:int}' |
no test coverage detected