#22572 - paths_from_template now correctly handles templates containing
optional keys