Skip to content
This repository was archived by the owner on May 9, 2025. It is now read-only.

Commit 9a982d4

Browse files
committed
[rust] Properly escape empty triple-braces
1 parent ff91eec commit 9a982d4

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

modules/openapi-generator/src/main/resources/rust/request.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ impl Request {
113113
let mut path = self.path;
114114
for (k, v) in self.path_params {
115115
// replace {id} with the value of the id path param
116-
path = path.replace(&format!("{{{}}}", k), &v);
116+
{{=<% %>=}}path = path.replace(&format!("{{{}}}", k), &v);<%={{ }}=%>
117117
}
118118

119119
for (k, v) in self.header_params {

samples/client/petstore/rust/hyper/fileResponseTest/src/apis/request.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ impl Request {
113113
let mut path = self.path;
114114
for (k, v) in self.path_params {
115115
// replace {id} with the value of the id path param
116-
path = path.replace(&format!("", k), &v);
116+
path = path.replace(&format!("{{{}}}", k), &v);
117117
}
118118

119119
for (k, v) in self.header_params {

samples/client/petstore/rust/hyper/petstore/src/apis/request.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ impl Request {
113113
let mut path = self.path;
114114
for (k, v) in self.path_params {
115115
// replace {id} with the value of the id path param
116-
path = path.replace(&format!("", k), &v);
116+
path = path.replace(&format!("{{{}}}", k), &v);
117117
}
118118

119119
for (k, v) in self.header_params {

samples/client/petstore/rust/hyper/rust-test/src/apis/request.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ impl Request {
113113
let mut path = self.path;
114114
for (k, v) in self.path_params {
115115
// replace {id} with the value of the id path param
116-
path = path.replace(&format!("", k), &v);
116+
path = path.replace(&format!("{{{}}}", k), &v);
117117
}
118118

119119
for (k, v) in self.header_params {

0 commit comments

Comments
 (0)