Skip to content

Commit 7ce0096

Browse files
authored
[Rust-Axum] Fix Regex (#22277)
1 parent 0ae50f5 commit 7ce0096

File tree

44 files changed

+56
-56
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+56
-56
lines changed

modules/openapi-generator/src/main/resources/rust-axum/Cargo.mustache

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ conversion = [
4242
ammonia = "4"
4343
async-trait = "0.1"
4444
axum = { version = "0.8", features = ["multipart"] }
45-
axum-extra = { version = "0.10", features = ["cookie", "query"] }
45+
axum-extra = { version = "0.12", features = ["cookie", "query"] }
4646
base64 = "0.22"
4747
bytes = "1"
4848
chrono = { version = "0.4", features = ["serde"] }

modules/openapi-generator/src/main/resources/rust-axum/models.mustache

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -182,12 +182,12 @@ pub fn check_xss_map<T>(v: &std::collections::HashMap<String, T>) -> std::result
182182
{{#pattern}}
183183
{{^isByteArray}}
184184
lazy_static::lazy_static! {
185-
static ref RE_{{#lambda.uppercase}}{{{operationIdCamelCase}}}HeaderParams_{{{paramName}}}{{/lambda.uppercase}}: regex::Regex = regex::Regex::new(r"{{ pattern }}").unwrap();
185+
static ref RE_{{#lambda.uppercase}}{{{operationIdCamelCase}}}HeaderParams_{{{paramName}}}{{/lambda.uppercase}}: regex::Regex = regex::Regex::new("{{ pattern }}").unwrap();
186186
}
187187
{{/isByteArray}}
188188
{{#isByteArray}}
189189
lazy_static::lazy_static! {
190-
static ref RE_{{#lambda.uppercase}}{{{operationIdCamelCase}}}HeaderParams_{{{paramName}}}{{/lambda.uppercase}}: regex::bytes::Regex = regex::bytes::Regex::new(r"{{ pattern }}").unwrap();
190+
static ref RE_{{#lambda.uppercase}}{{{operationIdCamelCase}}}HeaderParams_{{{paramName}}}{{/lambda.uppercase}}: regex::bytes::Regex = regex::bytes::Regex::new("{{ pattern }}").unwrap();
191191
}
192192
fn validate_byte_{{#lambda.lowercase}}{{{operationIdCamelCase}}}HeaderParams_{{{paramName}}}{{/lambda.lowercase}}(
193193
b: &ByteArray
@@ -332,12 +332,12 @@ pub fn check_xss_map<T>(v: &std::collections::HashMap<String, T>) -> std::result
332332
{{#pattern}}
333333
{{^isByteArray}}
334334
lazy_static::lazy_static! {
335-
static ref RE_{{#lambda.uppercase}}{{{operationIdCamelCase}}}PathParams_{{{paramName}}}{{/lambda.uppercase}}: regex::Regex = regex::Regex::new(r"{{ pattern }}").unwrap();
335+
static ref RE_{{#lambda.uppercase}}{{{operationIdCamelCase}}}PathParams_{{{paramName}}}{{/lambda.uppercase}}: regex::Regex = regex::Regex::new("{{ pattern }}").unwrap();
336336
}
337337
{{/isByteArray}}
338338
{{#isByteArray}}
339339
lazy_static::lazy_static! {
340-
static ref RE_{{#lambda.uppercase}}{{{operationIdCamelCase}}}PathParams_{{{paramName}}}{{/lambda.uppercase}}: regex::bytes::Regex = regex::bytes::Regex::new(r"{{ pattern }}").unwrap();
340+
static ref RE_{{#lambda.uppercase}}{{{operationIdCamelCase}}}PathParams_{{{paramName}}}{{/lambda.uppercase}}: regex::bytes::Regex = regex::bytes::Regex::new("{{ pattern }}").unwrap();
341341
}
342342
fn validate_byte_{{#lambda.lowercase}}{{{operationIdCamelCase}}}PathParams_{{{paramName}}}{{/lambda.lowercase}}(
343343
b: &ByteArray
@@ -494,12 +494,12 @@ pub fn check_xss_map<T>(v: &std::collections::HashMap<String, T>) -> std::result
494494
{{#pattern}}
495495
{{^isByteArray}}
496496
lazy_static::lazy_static! {
497-
static ref RE_{{#lambda.uppercase}}{{{operationIdCamelCase}}}QueryParams_{{{paramName}}}{{/lambda.uppercase}}: regex::Regex = regex::Regex::new(r"{{ pattern }}").unwrap();
497+
static ref RE_{{#lambda.uppercase}}{{{operationIdCamelCase}}}QueryParams_{{{paramName}}}{{/lambda.uppercase}}: regex::Regex = regex::Regex::new("{{ pattern }}").unwrap();
498498
}
499499
{{/isByteArray}}
500500
{{#isByteArray}}
501501
lazy_static::lazy_static! {
502-
static ref RE_{{#lambda.uppercase}}{{{operationIdCamelCase}}}QueryParams_{{{paramName}}}{{/lambda.uppercase}}: regex::bytes::Regex = regex::bytes::Regex::new(r"{{ pattern }}").unwrap();
502+
static ref RE_{{#lambda.uppercase}}{{{operationIdCamelCase}}}QueryParams_{{{paramName}}}{{/lambda.uppercase}}: regex::bytes::Regex = regex::bytes::Regex::new("{{ pattern }}").unwrap();
503503
}
504504
fn validate_byte_{{#lambda.lowercase}}{{{operationIdCamelCase}}}QueryParams_{{{paramName}}}{{/lambda.lowercase}}(
505505
b: &ByteArray
@@ -1096,12 +1096,12 @@ impl {{{classname}}} {
10961096
{{#pattern}}
10971097
{{^isByteArray}}
10981098
lazy_static::lazy_static! {
1099-
static ref RE_{{#lambda.uppercase}}{{{classname}}}_{{{name}}}{{/lambda.uppercase}}: regex::Regex = regex::Regex::new(r"{{ pattern }}").unwrap();
1099+
static ref RE_{{#lambda.uppercase}}{{{classname}}}_{{{name}}}{{/lambda.uppercase}}: regex::Regex = regex::Regex::new("{{ pattern }}").unwrap();
11001100
}
11011101
{{/isByteArray}}
11021102
{{#isByteArray}}
11031103
lazy_static::lazy_static! {
1104-
static ref RE_{{#lambda.uppercase}}{{{classname}}}_{{{name}}}{{/lambda.uppercase}}: regex::bytes::Regex = regex::bytes::Regex::new(r"{{ pattern }}").unwrap();
1104+
static ref RE_{{#lambda.uppercase}}{{{classname}}}_{{{name}}}{{/lambda.uppercase}}: regex::bytes::Regex = regex::bytes::Regex::new("{{ pattern }}").unwrap();
11051105
}
11061106
fn validate_byte_{{#lambda.lowercase}}{{{classname}}}_{{{name}}}{{/lambda.lowercase}}(
11071107
b: &ByteArray

modules/openapi-generator/src/main/resources/rust-axum/server-operation-validate.mustache

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,12 +119,12 @@
119119
{{#pattern}}
120120
{{#isString}}
121121
lazy_static::lazy_static! {
122-
static ref RE_{{#lambda.uppercase}}{{{operationIdCamelCase}}}BodyValidator{{/lambda.uppercase}}: regex::Regex = regex::Regex::new(r"{{ pattern }}").unwrap();
122+
static ref RE_{{#lambda.uppercase}}{{{operationIdCamelCase}}}BodyValidator{{/lambda.uppercase}}: regex::Regex = regex::Regex::new("{{ pattern }}").unwrap();
123123
}
124124
{{/isString}}
125125
{{^isString}}
126126
lazy_static::lazy_static! {
127-
static ref RE_{{#lambda.uppercase}}{{{operationIdCamelCase}}}BodyValidator{{/lambda.uppercase}}: regex::bytes::Regex = regex::bytes::Regex::new(r"{{ pattern }}").unwrap();
127+
static ref RE_{{#lambda.uppercase}}{{{operationIdCamelCase}}}BodyValidator{{/lambda.uppercase}}: regex::bytes::Regex = regex::bytes::Regex::new("{{ pattern }}").unwrap();
128128
}
129129
fn validate_byte_{{#lambda.lowercase}}{{{operationIdCamelCase}}}BodyValidator{{/lambda.lowercase}}(
130130
b: &[u8]
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
7.17.0-SNAPSHOT
1+
7.18.0-SNAPSHOT

samples/server/petstore/rust-axum/output/apikey-authorization/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ conversion = [
2121
ammonia = "4"
2222
async-trait = "0.1"
2323
axum = { version = "0.8", features = ["multipart"] }
24-
axum-extra = { version = "0.10", features = ["cookie", "query"] }
24+
axum-extra = { version = "0.12", features = ["cookie", "query"] }
2525
base64 = "0.22"
2626
bytes = "1"
2727
chrono = { version = "0.4", features = ["serde"] }

samples/server/petstore/rust-axum/output/apikey-authorization/README.md

Lines changed: 1 addition & 1 deletion
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
7.17.0-SNAPSHOT
1+
7.18.0-SNAPSHOT

samples/server/petstore/rust-axum/output/apikey-auths/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ conversion = [
2121
ammonia = "4"
2222
async-trait = "0.1"
2323
axum = { version = "0.8", features = ["multipart"] }
24-
axum-extra = { version = "0.10", features = ["cookie", "query"] }
24+
axum-extra = { version = "0.12", features = ["cookie", "query"] }
2525
base64 = "0.22"
2626
bytes = "1"
2727
chrono = { version = "0.4", features = ["serde"] }

samples/server/petstore/rust-axum/output/apikey-auths/README.md

Lines changed: 1 addition & 1 deletion
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
7.17.0-SNAPSHOT
1+
7.18.0-SNAPSHOT

0 commit comments

Comments
 (0)