@@ -207,9 +207,16 @@ impl CodeGenerator {
207207 . collect ( ) ;
208208
209209 // Sanitize operation ID to a valid Rust identifier for the static name
210- let sanitized_id: String = op. operation_id
210+ let sanitized_id: String = op
211+ . operation_id
211212 . chars ( )
212- . map ( |c| if c. is_ascii_alphanumeric ( ) { c. to_ascii_uppercase ( ) } else { '_' } )
213+ . map ( |c| {
214+ if c. is_ascii_alphanumeric ( ) {
215+ c. to_ascii_uppercase ( )
216+ } else {
217+ '_'
218+ }
219+ } )
213220 . collect ( ) ;
214221 let params_static_name = syn:: Ident :: new (
215222 & format ! ( "PARAMS_{sanitized_id}" ) ,
@@ -227,12 +234,14 @@ impl CodeGenerator {
227234 Some ( rb) => {
228235 use crate :: analysis:: RequestBodyContent ;
229236 let ( content_type, schema_name) = match rb {
230- RequestBodyContent :: Json { schema_name } => {
231- ( quote ! { BodyContentType :: Json } , quote ! { Some ( #schema_name) } )
232- }
233- RequestBodyContent :: FormUrlEncoded { schema_name } => {
234- ( quote ! { BodyContentType :: FormUrlEncoded } , quote ! { Some ( #schema_name) } )
235- }
237+ RequestBodyContent :: Json { schema_name } => (
238+ quote ! { BodyContentType :: Json } ,
239+ quote ! { Some ( #schema_name) } ,
240+ ) ,
241+ RequestBodyContent :: FormUrlEncoded { schema_name } => (
242+ quote ! { BodyContentType :: FormUrlEncoded } ,
243+ quote ! { Some ( #schema_name) } ,
244+ ) ,
236245 RequestBodyContent :: Multipart => {
237246 ( quote ! { BodyContentType :: Multipart } , quote ! { None } )
238247 }
0 commit comments