Skip to content

Commit cdff007

Browse files
authored
Fix typos (#1497)
* Fix typos * fmt
1 parent a024aca commit cdff007

File tree

9 files changed

+29
-27
lines changed

9 files changed

+29
-27
lines changed

utoipa-gen/CHANGELOG.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -495,7 +495,7 @@
495495
* Add derive info support for derive OpenApi (https://github.com/juhaku/utoipa/pull/400)
496496
* Add `merge` functionality for `OpenApi` (https://github.com/juhaku/utoipa/pull/397)
497497
* Add derive servers attribute for OpenApi (https://github.com/juhaku/utoipa/pull/395)
498-
* Add support for unit sructs (https://github.com/juhaku/utoipa/pull/392)
498+
* Add support for unit structs (https://github.com/juhaku/utoipa/pull/392)
499499
* Add support for `schema_with` custom fn reference (https://github.com/juhaku/utoipa/pull/390)
500500
* Add support for multiple serde definitions (https://github.com/juhaku/utoipa/pull/389)
501501
* Add support for tuple Path parameters for axum (https://github.com/juhaku/utoipa/pull/388)
@@ -534,7 +534,7 @@
534534
* Update `ToSchema` documentation
535535
* Chore make `serde_json` mandatory dependency (https://github.com/juhaku/utoipa/pull/378)
536536
* Feature http status codes (https://github.com/juhaku/utoipa/pull/376)
537-
* Refactor some path derive with `IntoParmas` tests
537+
* Refactor some path derive with `IntoParams` tests
538538
* Chore refine description attribute (https://github.com/juhaku/utoipa/pull/373)
539539
* cargo format
540540
* Update to axum 0.6.0 (https://github.com/juhaku/utoipa/pull/369)

utoipa-gen/src/ext.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ impl ExtSchema<'_> {
123123
} else {
124124
Cow::Borrowed(actual_body)
125125
}
126-
}).expect("ExtSchema must have actual request body resoved from TypeTree of handler fn argument")
126+
}).expect("ExtSchema must have actual request body resolved from TypeTree of handler fn argument")
127127
}
128128

129129
pub fn get_type_tree(&self) -> Result<Option<Cow<'_, TypeTree<'_>>>, Diagnostics> {

utoipa-gen/src/lib.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ static CONFIG: once_cell::sync::Lazy<utoipa_config::Config> =
135135
/// * `min_properties = ...` Can be used to define minimum number of properties this struct can
136136
/// contain. Value must be a number.
137137
///* `no_recursion` Is used to break from recursion in case of looping schema tree e.g. `Pet` ->
138-
/// `Owner` -> `Pet`. _`no_recursion`_ attribute must be used within `Ower` type not to allow
138+
/// `Owner` -> `Pet`. _`no_recursion`_ attribute must be used within `Owner` type not to allow
139139
/// recurring into `Pet`. Failing to do so will cause infinite loop and runtime **panic**. On
140140
/// struct level the _`no_recursion`_ rule will be applied to all of its fields.
141141
///
@@ -202,7 +202,7 @@ static CONFIG: once_cell::sync::Lazy<utoipa_config::Config> =
202202
///* `ignore` or `ignore = ...` Can be used to skip the field from being serialized to OpenAPI schema. It accepts either a literal `bool` value
203203
/// or a path to a function that returns `bool` (`Fn() -> bool`).
204204
///* `no_recursion` Is used to break from recursion in case of looping schema tree e.g. `Pet` ->
205-
/// `Owner` -> `Pet`. _`no_recursion`_ attribute must be used within `Ower` type not to allow
205+
/// `Owner` -> `Pet`. _`no_recursion`_ attribute must be used within `Owner` type not to allow
206206
/// recurring into `Pet`. Failing to do so will cause infinite loop and runtime **panic**.
207207
///
208208
/// #### Field nullability and required rules
@@ -267,7 +267,7 @@ static CONFIG: once_cell::sync::Lazy<utoipa_config::Config> =
267267
/// * `content_media_type = ...` Can be used to define MIME type of a string for underlying schema object.
268268
/// See [`Object::content_media_type`][schema_object_media_type]
269269
///* `no_recursion` Is used to break from recursion in case of looping schema tree e.g. `Pet` ->
270-
/// `Owner` -> `Pet`. _`no_recursion`_ attribute must be used within `Ower` type not to allow
270+
/// `Owner` -> `Pet`. _`no_recursion`_ attribute must be used within `Owner` type not to allow
271271
/// recurring into `Pet`. Failing to do so will cause infinite loop and runtime **panic**.
272272
///
273273
/// # Enum Optional Configuration Options for `#[schema(...)]`
@@ -335,7 +335,7 @@ static CONFIG: once_cell::sync::Lazy<utoipa_config::Config> =
335335
/// field for enums with single unnamed _`ToSchema`_ reference field. See the [discriminator
336336
/// syntax][derive@ToSchema#schemadiscriminator-syntax].
337337
///* `no_recursion` Is used to break from recursion in case of looping schema tree e.g. `Pet` ->
338-
/// `Owner` -> `Pet`. _`no_recursion`_ attribute must be used within `Ower` type not to allow
338+
/// `Owner` -> `Pet`. _`no_recursion`_ attribute must be used within `Owner` type not to allow
339339
/// recurring into `Pet`. Failing to do so will cause infinite loop and runtime **panic**. On
340340
/// enum level the _`no_recursion`_ rule will be applied to all of its variants.
341341
///
@@ -391,7 +391,7 @@ static CONFIG: once_cell::sync::Lazy<utoipa_config::Config> =
391391
/// * `min_properties = ...` Can be used to define minimum number of properties this struct can
392392
/// contain. Value must be a number.
393393
///* `no_recursion` Is used to break from recursion in case of looping schema tree e.g. `Pet` ->
394-
/// `Owner` -> `Pet`. _`no_recursion`_ attribute must be used within `Ower` type not to allow
394+
/// `Owner` -> `Pet`. _`no_recursion`_ attribute must be used within `Owner` type not to allow
395395
/// recurring into `Pet`. Failing to do so will cause infinite loop and runtime **panic**. On
396396
/// named field variant level the _`no_recursion`_ rule will be applied to all of its fields.
397397
///
@@ -422,7 +422,7 @@ static CONFIG: once_cell::sync::Lazy<utoipa_config::Config> =
422422
/// not in the code. If you'd like to mark the field as deprecated in the code as well use
423423
/// Rust's own `#[deprecated]` attribute instead.
424424
///* `no_recursion` Is used to break from recursion in case of looping schema tree e.g. `Pet` ->
425-
/// `Owner` -> `Pet`. _`no_recursion`_ attribute must be used within `Ower` type not to allow
425+
/// `Owner` -> `Pet`. _`no_recursion`_ attribute must be used within `Owner` type not to allow
426426
/// recurring into `Pet`. Failing to do so will cause infinite loop and runtime **panic**.
427427
///
428428
/// #### Mixed Enum Unnamed Field Variant's Field Configuration Options
@@ -3771,7 +3771,7 @@ mod parse_utils {
37713771
Punctuated::parse_terminated(&group)
37723772
}
37733773

3774-
pub fn parse_comma_separated_within_parethesis_with<T>(
3774+
pub fn parse_comma_separated_within_parenthesis_with<T>(
37753775
input: ParseStream,
37763776
with: fn(ParseStream) -> syn::Result<T>,
37773777
) -> syn::Result<Punctuated<T, Comma>>

utoipa-gen/src/openapi/info.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -412,19 +412,19 @@ mod tests {
412412
#[test]
413413
fn contact_from_only_name() {
414414
let author = "Suzy Lin";
415-
let contanct = Contact::try_from(author.to_string()).unwrap();
415+
let contact = Contact::try_from(author.to_string()).unwrap();
416416

417-
assert!(contanct.name.is_some(), "Suzy should have name");
418-
assert!(contanct.email.is_none(), "Suzy should not have email");
417+
assert!(contact.name.is_some(), "Suzy should have name");
418+
assert!(contact.email.is_none(), "Suzy should not have email");
419419
}
420420

421421
#[test]
422422
fn contact_from_name_and_email() {
423423
let author = "Suzy Lin <suzy@lin.com>";
424-
let contanct = Contact::try_from(author.to_string()).unwrap();
424+
let contact = Contact::try_from(author.to_string()).unwrap();
425425

426-
assert!(contanct.name.is_some(), "Suzy should have name");
427-
assert!(contanct.email.is_some(), "Suzy should have email");
426+
assert!(contact.name.is_some(), "Suzy should have name");
427+
assert!(contact.email.is_some(), "Suzy should have email");
428428
}
429429

430430
#[test]

utoipa-gen/src/path.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ impl HttpMethod {
245245
.map_err(|error| {
246246
let mut diagnostics = Diagnostics::with_span(ident.span(), error.to_string());
247247
if name == "connect" {
248-
diagnostics = diagnostics.note("HTTP method `CONNET` is not supported by OpenAPI spec <https://spec.openapis.org/oas/latest.html#path-item-object>");
248+
diagnostics = diagnostics.note("HTTP method `CONNECT` is not supported by OpenAPI spec <https://spec.openapis.org/oas/latest.html#path-item-object>");
249249
}
250250

251251
diagnostics

utoipa-gen/src/path/request_body.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ impl Parse for RequestBodyAttr<'_> {
145145
}
146146

147147
let media_type =
148-
parse_utils::parse_comma_separated_within_parethesis_with(
148+
parse_utils::parse_comma_separated_within_parenthesis_with(
149149
&group,
150150
group_parser,
151151
)?

utoipa-gen/src/path/response.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -313,10 +313,12 @@ impl<'r> ResponseValue<'r> {
313313
buf.call(MediaTypeAttr::parse)
314314
}
315315

316-
let content =
317-
parse_utils::parse_comma_separated_within_parethesis_with(input, group_parser)?
318-
.into_iter()
319-
.collect::<Vec<_>>();
316+
let content = parse_utils::parse_comma_separated_within_parenthesis_with(
317+
input,
318+
group_parser,
319+
)?
320+
.into_iter()
321+
.collect::<Vec<_>>();
320322

321323
self.content = content;
322324
}

utoipa-gen/tests/path_derive_axum_test.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -211,13 +211,13 @@ fn derive_path_params_with_unnamed_struct_destructed() {
211211
fn derive_path_query_params_with_named_struct_destructed() {
212212
#[derive(IntoParams)]
213213
#[allow(unused)]
214-
struct QueryParmas<'q> {
214+
struct QueryParams<'q> {
215215
name: &'q str,
216216
}
217217

218-
#[utoipa::path(get, path = "/item", params(QueryParmas))]
218+
#[utoipa::path(get, path = "/item", params(QueryParams))]
219219
#[allow(unused)]
220-
async fn get_item(Query(QueryParmas { name }): Query<QueryParmas<'static>>) {}
220+
async fn get_item(Query(QueryParams { name }): Query<QueryParams<'static>>) {}
221221

222222
#[derive(OpenApi)]
223223
#[openapi(paths(get_item))]

utoipa/CHANGELOG.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -493,7 +493,7 @@ Migration guide: https://github.com/juhaku/utoipa/discussions/456
493493
* Add derive info support for derive OpenApi (https://github.com/juhaku/utoipa/pull/400)
494494
* Add `merge` functionality for `OpenApi` (https://github.com/juhaku/utoipa/pull/397)
495495
* Add derive servers attribute for OpenApi (https://github.com/juhaku/utoipa/pull/395)
496-
* Add support for unit sructs (https://github.com/juhaku/utoipa/pull/392)
496+
* Add support for unit structs (https://github.com/juhaku/utoipa/pull/392)
497497
* Add support for `schema_with` custom fn reference (https://github.com/juhaku/utoipa/pull/390)
498498
* Add support for multiple serde definitions (https://github.com/juhaku/utoipa/pull/389)
499499
* Add support for tuple Path parameters for axum (https://github.com/juhaku/utoipa/pull/388)
@@ -542,7 +542,7 @@ Migration guide: https://github.com/juhaku/utoipa/discussions/456
542542
* Use BTreeMap for responses of components to make it fixed order (https://github.com/juhaku/utoipa/pull/380)
543543
* Chore make `serde_json` mandatory dependency (https://github.com/juhaku/utoipa/pull/378)
544544
* Feature http status codes (https://github.com/juhaku/utoipa/pull/376)
545-
* Refactor some path derive with `IntoParmas` tests
545+
* Refactor some path derive with `IntoParams` tests
546546
* Update utoipa-swagger-ui install example
547547
* Chore refine description attribute (https://github.com/juhaku/utoipa/pull/373)
548548
* Update swagger-ui dependencies versions

0 commit comments

Comments
 (0)