diff --git a/modules/openapi-generator/src/main/resources/rust-axum/server-operation.mustache b/modules/openapi-generator/src/main/resources/rust-axum/server-operation.mustache index 4ca44568d1f2..ceb477b11443 100644 --- a/modules/openapi-generator/src/main/resources/rust-axum/server-operation.mustache +++ b/modules/openapi-generator/src/main/resources/rust-axum/server-operation.mustache @@ -89,7 +89,7 @@ where // Header parameters let header_params = { {{/-first}} - let header_{{{paramName}}} = headers.get(HeaderName::from_static("{{{baseName}}}")); + let header_{{{paramName}}} = headers.get(HeaderName::from_static("{{{nameInLowerCase}}}")); let header_{{{paramName}}} = match header_{{{paramName}}} { Some(v) => match header::IntoHeaderValue::<{{{dataType}}}>::try_from((*v).clone()) { @@ -272,7 +272,7 @@ where { let mut response_headers = response.headers_mut().unwrap(); response_headers.insert( - HeaderName::from_static("{{{baseName}}}"), + HeaderName::from_static("{{{nameInLowerCase}}}"), {{name}} ); } diff --git a/samples/server/petstore/rust-axum/output/openapi-v3/src/server/mod.rs b/samples/server/petstore/rust-axum/output/openapi-v3/src/server/mod.rs index 8b31ce9b9e69..666120206b69 100644 --- a/samples/server/petstore/rust-axum/output/openapi-v3/src/server/mod.rs +++ b/samples/server/petstore/rust-axum/output/openapi-v3/src/server/mod.rs @@ -602,7 +602,7 @@ where { // Header parameters let header_params = { - let header_x_header = headers.get(HeaderName::from_static("X-Header")); + let header_x_header = headers.get(HeaderName::from_static("x-header")); let header_x_header = match header_x_header { Some(v) => match header::IntoHeaderValue::::try_from((*v).clone()) { @@ -1471,7 +1471,7 @@ where { let mut response_headers = response.headers_mut().unwrap(); - response_headers.insert(HeaderName::from_static("Success-Info"), success_info); + response_headers.insert(HeaderName::from_static("success-info"), success_info); } if let Some(bool_header) = bool_header { let bool_header = match header::IntoHeaderValue(bool_header).try_into() { @@ -1486,7 +1486,7 @@ where { let mut response_headers = response.headers_mut().unwrap(); response_headers - .insert(HeaderName::from_static("Bool-Header"), bool_header); + .insert(HeaderName::from_static("bool-header"), bool_header); } } if let Some(object_header) = object_header { @@ -1502,7 +1502,7 @@ where { let mut response_headers = response.headers_mut().unwrap(); response_headers - .insert(HeaderName::from_static("Object-Header"), object_header); + .insert(HeaderName::from_static("object-header"), object_header); } } let mut response = response.status(200); @@ -1544,7 +1544,7 @@ where { let mut response_headers = response.headers_mut().unwrap(); response_headers - .insert(HeaderName::from_static("Further-Info"), further_info); + .insert(HeaderName::from_static("further-info"), further_info); } } if let Some(failure_info) = failure_info { @@ -1560,7 +1560,7 @@ where { let mut response_headers = response.headers_mut().unwrap(); response_headers - .insert(HeaderName::from_static("Failure-Info"), failure_info); + .insert(HeaderName::from_static("failure-info"), failure_info); } } let mut response = response.status(412); diff --git a/samples/server/petstore/rust-axum/output/petstore-with-fake-endpoints-models-for-testing/src/server/mod.rs b/samples/server/petstore/rust-axum/output/petstore-with-fake-endpoints-models-for-testing/src/server/mod.rs index 874654e6a21b..33a54a8cc5da 100644 --- a/samples/server/petstore/rust-axum/output/petstore-with-fake-endpoints-models-for-testing/src/server/mod.rs +++ b/samples/server/petstore/rust-axum/output/petstore-with-fake-endpoints-models-for-testing/src/server/mod.rs @@ -2693,7 +2693,7 @@ where { let mut response_headers = response.headers_mut().unwrap(); response_headers - .insert(HeaderName::from_static("X-Rate-Limit"), x_rate_limit); + .insert(HeaderName::from_static("x-rate-limit"), x_rate_limit); } } if let Some(x_expires_after) = x_expires_after { @@ -2710,7 +2710,7 @@ where { let mut response_headers = response.headers_mut().unwrap(); response_headers - .insert(HeaderName::from_static("X-Expires-After"), x_expires_after); + .insert(HeaderName::from_static("x-expires-after"), x_expires_after); } } let mut response = response.status(200); diff --git a/samples/server/petstore/rust-axum/output/petstore/src/server/mod.rs b/samples/server/petstore/rust-axum/output/petstore/src/server/mod.rs index 4d5ec41b5993..edb1b82fc442 100644 --- a/samples/server/petstore/rust-axum/output/petstore/src/server/mod.rs +++ b/samples/server/petstore/rust-axum/output/petstore/src/server/mod.rs @@ -1517,7 +1517,7 @@ where { let mut response_headers = response.headers_mut().unwrap(); - response_headers.insert(HeaderName::from_static("Set-Cookie"), set_cookie); + response_headers.insert(HeaderName::from_static("set-cookie"), set_cookie); } } if let Some(x_rate_limit) = x_rate_limit { @@ -1533,7 +1533,7 @@ where { let mut response_headers = response.headers_mut().unwrap(); response_headers - .insert(HeaderName::from_static("X-Rate-Limit"), x_rate_limit); + .insert(HeaderName::from_static("x-rate-limit"), x_rate_limit); } } if let Some(x_expires_after) = x_expires_after { @@ -1550,7 +1550,7 @@ where { let mut response_headers = response.headers_mut().unwrap(); response_headers - .insert(HeaderName::from_static("X-Expires-After"), x_expires_after); + .insert(HeaderName::from_static("x-expires-after"), x_expires_after); } } let mut response = response.status(200);