Skip to content

Commit 5d0b38d

Browse files
committed
Reformat code for improved readability
Adjusted line breaks and indentation in spec.rs and native_openapi_demo.rs to enhance code clarity and maintain consistent formatting. No functional changes were made.
1 parent 23c0886 commit 5d0b38d

File tree

2 files changed

+13
-6
lines changed

2 files changed

+13
-6
lines changed

crates/rustapi-openapi/src/spec.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,7 @@ impl OpenApiSpec {
5959
..Default::default()
6060
},
6161
// Use OpenAPI 3.1 default dialect for maximum Swagger UI compatibility
62-
json_schema_dialect: Some(
63-
"https://spec.openapis.org/oas/3.1/dialect/base".to_string(),
64-
),
62+
json_schema_dialect: Some("https://spec.openapis.org/oas/3.1/dialect/base".to_string()),
6563
servers: Vec::new(),
6664
paths: BTreeMap::new(),
6765
webhooks: BTreeMap::new(),

crates/rustapi-rs/examples/native_openapi_demo.rs

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,10 @@ async fn list_users(Query(query): Query<ListUsersQuery>) -> Json<UserListRespons
141141
profile: Some(UserProfile {
142142
bio: Some("Software developer".to_string()),
143143
avatar_url: None,
144-
social_links: HashMap::from([("github".to_string(), "https://github.com/alice".to_string())]),
144+
social_links: HashMap::from([(
145+
"github".to_string(),
146+
"https://github.com/alice".to_string(),
147+
)]),
145148
}),
146149
},
147150
User {
@@ -288,7 +291,10 @@ mod tests {
288291
let _ = User::schema(&mut ctx);
289292

290293
// Get the User schema from components
291-
let user_schema = ctx.components.get("User").expect("User schema should exist");
294+
let user_schema = ctx
295+
.components
296+
.get("User")
297+
.expect("User schema should exist");
292298

293299
// Check properties exist
294300
assert!(user_schema.properties.is_some());
@@ -311,6 +317,9 @@ mod tests {
311317
fn test_component_name() {
312318
assert_eq!(User::component_name(), Some("User"));
313319
assert_eq!(UserProfile::component_name(), Some("UserProfile"));
314-
assert_eq!(CreateUserRequest::component_name(), Some("CreateUserRequest"));
320+
assert_eq!(
321+
CreateUserRequest::component_name(),
322+
Some("CreateUserRequest")
323+
);
315324
}
316325
}

0 commit comments

Comments
 (0)