Skip to content

Commit

Permalink
Fix spelling (#450)
Browse files Browse the repository at this point in the history
  • Loading branch information
jayvdb authored Jan 24, 2023
1 parent 6327492 commit 2e13074
Show file tree
Hide file tree
Showing 55 changed files with 231 additions and 231 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@
[![docs.rs](https://img.shields.io/static/v1?label=docs.rs&message=utoipa&color=blue&logo=data:image/svg+xml;base64,PHN2ZyByb2xlPSJpbWciIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgdmlld0JveD0iMCAwIDUxMiA1MTIiPjxwYXRoIGZpbGw9IiNmNWY1ZjUiIGQ9Ik00ODguNiAyNTAuMkwzOTIgMjE0VjEwNS41YzAtMTUtOS4zLTI4LjQtMjMuNC0zMy43bC0xMDAtMzcuNWMtOC4xLTMuMS0xNy4xLTMuMS0yNS4zIDBsLTEwMCAzNy41Yy0xNC4xIDUuMy0yMy40IDE4LjctMjMuNCAzMy43VjIxNGwtOTYuNiAzNi4yQzkuMyAyNTUuNSAwIDI2OC45IDAgMjgzLjlWMzk0YzAgMTMuNiA3LjcgMjYuMSAxOS45IDMyLjJsMTAwIDUwYzEwLjEgNS4xIDIyLjEgNS4xIDMyLjIgMGwxMDMuOS01MiAxMDMuOSA1MmMxMC4xIDUuMSAyMi4xIDUuMSAzMi4yIDBsMTAwLTUwYzEyLjItNi4xIDE5LjktMTguNiAxOS45LTMyLjJWMjgzLjljMC0xNS05LjMtMjguNC0yMy40LTMzLjd6TTM1OCAyMTQuOGwtODUgMzEuOXYtNjguMmw4NS0zN3Y3My4zek0xNTQgMTA0LjFsMTAyLTM4LjIgMTAyIDM4LjJ2LjZsLTEwMiA0MS40LTEwMi00MS40di0uNnptODQgMjkxLjFsLTg1IDQyLjV2LTc5LjFsODUtMzguOHY3NS40em0wLTExMmwtMTAyIDQxLjQtMTAyLTQxLjR2LS42bDEwMi0zOC4yIDEwMiAzOC4ydi42em0yNDAgMTEybC04NSA0Mi41di03OS4xbDg1LTM4Ljh2NzUuNHptMC0xMTJsLTEwMiA0MS40LTEwMi00MS40di0uNmwxMDItMzguMiAxMDIgMzguMnYuNnoiPjwvcGF0aD48L3N2Zz4K)](https://docs.rs/utoipa/latest/utoipa/)
![MSRV](https://img.shields.io/static/v1?label=MSRV&message=1.60%2B&color=orange&logo=rust)

Want to have your API documented with OpenAPI? But you dont want to see the
trouble with manual yaml or json tweaking? Would like it to be so easy that it would almost
Want to have your API documented with OpenAPI? But you don't want to see the
trouble with manual YAML or JSON tweaking? Would like it to be so easy that it would almost
be like utopic? Don't worry utoipa is just there to fill this gap. It aims to do if not all then
the most of heavy lifting for you enabling you to focus writing the actual API logic instead of
documentation. It aims to be _minimal_, _simple_ and _fast_. It uses simple proc macros which
you can use to annotate your code to have items documented.

Utoipa crate provides auto generated OpenAPI documentation for Rust REST APIs. It treats
code first appoach as a first class citizen and simplifies API documentation by providing
code first approach as a first class citizen and simplifies API documentation by providing
simple macros for generating the documentation from your code.

It also contains Rust types of OpenAPI spec allowing you to write the OpenAPI spec only using
Expand All @@ -23,7 +23,7 @@ Long term goal of the library is to be the place to go when OpenAPI documentatio
codebase.

Utoipa is framework agnostic and could be used together with any web framework or even without one. While
being portable and standalone one of it's key aspects is simple integration with web frameworks.
being portable and standalone one of its key aspects is simple integration with web frameworks.

## Choose your flavor and document your API with ice cold IPA

Expand Down Expand Up @@ -103,8 +103,8 @@ utoipa = { version = "3", features = ["actix_extras"] }

## Examples

Create a struct or it could be an enum also. Add `ToSchema` derive macro to it so it can be registered
as an an OpenAPI schema.
Create a struct, or it could be an enum also. Add `ToSchema` derive macro to it, so it can be registered
as an OpenAPI schema.

```rust
use utoipa::ToSchema;
Expand Down
2 changes: 1 addition & 1 deletion examples/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# utoipa examples

This is folder contain a set of examples of utoipa library which should help people to get started
with the library.
with the library.
2 changes: 1 addition & 1 deletion examples/actix-web-multiple-api-docs-with-scopes/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# actix-web-multiple-api-docs-with-scopes ~ utoipa with utoipa-swagger-ui example

This is demo `actix-web` application with mutliple api docs with scope and context path.
This is demo `actix-web` application with multiple API docs with scope and context path.

Just run command below to run the demo application and browse to `http://localhost:8080/swagger-ui/`.
```bash
Expand Down
2 changes: 1 addition & 1 deletion examples/rocket-0_4-hello/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# hello rocket 0.4.x versio ~ utoipa with utoipa-swagger-ui example
# hello rocket 0.4.x version ~ utoipa with utoipa-swagger-ui example

This is hello world `rocket 0.4.x` version example with `utoipa` and `utoipa-swagger-ui`.

Expand Down
2 changes: 1 addition & 1 deletion examples/rocket-todo/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# todo-rocket ~ utoipa with utoipa-swagger-ui example

This is demo `rocket` application with in-memory storage to manage Todo items. The API
demostrates `utoipa` with `utoipa-swagger-ui` functionalities.
demonstrates `utoipa` with `utoipa-swagger-ui` functionalities.

For security restricted endpoints the super secret api key is: `utoipa-rocks`.

Expand Down
6 changes: 3 additions & 3 deletions examples/rocket-todo/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ fn rocket() -> Rocket<Build> {
todo::create_todo,
todo::mark_done,
todo::delete_todo,
todo::search_todos
todo::search_todos,
),
components(
schemas(todo::Todo, todo::TodoError)
Expand Down Expand Up @@ -151,10 +151,10 @@ mod todo {
/// Unique todo id.
#[schema(example = 1)]
id: i32,
/// Description of a taks.
/// Description of a tasks.
#[schema(example = "Buy groceries")]
value: String,
/// Indicatation whether task is done or not.
/// Indication whether task is done or not.
done: bool,
}

Expand Down
2 changes: 1 addition & 1 deletion examples/todo-actix/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# todo-actix ~ utoipa with utoipa-swagger-ui example

This is demo `actix-web` application with in-memory storage to manage Todo items. The API
demostrates `utoipa` with `utoipa-swagger-ui` functionalities.
demonstrates `utoipa` with `utoipa-swagger-ui` functionalities.

For security restricted endpoints the super secret api key is: `utoipa-rocks`.

Expand Down
4 changes: 2 additions & 2 deletions examples/todo-actix/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ async fn main() -> Result<(), impl Error> {
.await
}

/// Require api key middlware will actually require valid api key
/// Require api key middleware will actually require valid api key
struct RequireApiKey;

impl<S> Transform<S, ServiceRequest> for RequireApiKey
Expand All @@ -104,7 +104,7 @@ where
}
}

/// Log api key midleware only logs about missing or invalid api keys
/// Log api key middleware only logs about missing or invalid api keys
struct LogApiKey;

impl<S> Transform<S, ServiceRequest> for LogApiKey
Expand Down
10 changes: 5 additions & 5 deletions examples/todo-actix/src/todo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ pub(super) struct Todo {
/// Unique id for the todo item.
#[schema(example = 1)]
id: i32,
/// Description of the taks to do.
/// Description of the tasks to do.
#[schema(example = "Remember to buy groceries")]
value: String,
/// Mark is the task done or not
Expand All @@ -58,15 +58,15 @@ pub(super) enum ErrorResponse {
NotFound(String),
/// When there is a conflict storing a new todo.
Conflict(String),
/// When todo enpoint was called without correct credentials
/// When todo endpoint was called without correct credentials
Unauthorized(String),
}

/// Get list of todos.
///
/// List todos from in-memory todo store.
///
/// One could call the api endpoit with following curl.
/// One could call the api endpoint with following curl.
/// ```text
/// curl localhost:8080/todo
/// ```
Expand Down Expand Up @@ -118,7 +118,7 @@ pub(super) async fn create_todo(todo: Json<Todo>, todo_store: Data<TodoStore>) -

/// Delete Todo by given path variable id.
///
/// This ednpoint needs `api_key` authentication in order to call. Api key can be found from README.md.
/// This endpoint needs `api_key` authentication in order to call. Api key can be found from README.md.
///
/// Api will delete todo from shared in-memory storage by the provided id and return success 200.
/// If storage does not contain `Todo` with given id 404 not found will be returned.
Expand Down Expand Up @@ -239,7 +239,7 @@ pub(super) struct SearchTodos {
/// Search Todos with by value
///
/// Perform search from `Todo`s present in in-memory storage by matching Todo's value to
/// value provided as query paramter. Returns 200 and matching `Todo` items.
/// value provided as query parameter. Returns 200 and matching `Todo` items.
#[utoipa::path(
params(
SearchTodos
Expand Down
2 changes: 1 addition & 1 deletion examples/todo-axum/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# todo-axum ~ utoipa with utoipa-swagger-ui example

This is demo `axum` application with in-memory storage to manage Todo items. The API
demostrates `utoipa` with `utoipa-swagger-ui` functionalities.
demonstrates `utoipa` with `utoipa-swagger-ui` functionalities.

For security restricted endpoints the super secret api key is: `utoipa-rocks`.

Expand Down
6 changes: 3 additions & 3 deletions examples/todo-axum/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ mod todo {
use tokio::sync::Mutex;
use utoipa::{IntoParams, ToSchema};

/// In-memonry todo store
/// In-memory todo store
pub(super) type Store = Mutex<Vec<Todo>>;

/// Item to do.
Expand Down Expand Up @@ -131,7 +131,7 @@ mod todo {

/// Search Todos by query params.
///
/// Search `Todo`s by query parmas and return matching `Todo`s.
/// Search `Todo`s by query params and return matching `Todo`s.
#[utoipa::path(
get,
path = "/todo/search",
Expand Down Expand Up @@ -283,7 +283,7 @@ mod todo {
}
}

// normally you should create a midleware for this but this is sufficient for sake of example.
// normally you should create a middleware for this but this is sufficient for sake of example.
fn check_api_key(require_api_key: bool, headers: HeaderMap) -> Result<(), impl IntoResponse> {
match headers.get("todo_apikey") {
Some(header) if header != "utoipa-rocks" => Err((
Expand Down
2 changes: 1 addition & 1 deletion examples/todo-tide/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# todo-tide ~ utoipa with utoipa-swagger-ui example

This is demo `tide` application with in-memory storage to manage Todo items. The API
demostrates `utoipa` with `utoipa-swagger-ui` functionalities.
demonstrates `utoipa` with `utoipa-swagger-ui` functionalities.

For security restricted endpoints the super secret api key is: `utoipa-rocks`.

Expand Down
4 changes: 2 additions & 2 deletions examples/todo-tide/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,15 +109,15 @@ mod todo {
/// Error that might occur when managing `Todo` items
#[derive(Serialize, Deserialize, ToSchema)]
pub(super) enum TodoError {
/// Happens when Todo item alredy exists
/// Happens when Todo item already exists
Config(String),
/// Todo not found from storage
NotFound(String),
}

pub(super) type Store = Arc<Mutex<Vec<Todo>>>;

/// List todos from in-memory stoarge.
/// List todos from in-memory storage.
///
/// List all todos from in memory storage.
#[utoipa::path(
Expand Down
4 changes: 2 additions & 2 deletions examples/todo-warp/README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# todo-warp ~ utoipa with utoipa-swagger-ui example

This is demo `warp` application with in-memory storage to manage Todo items. The API
demostrates `utoipa` with `utoipa-swagger-ui` functionalities.
demonstrates `utoipa` with `utoipa-swagger-ui` functionalities.

This example is more bare minimum compared to `todo-actix` since similary same macro syntax is
This example is more bare minimum compared to `todo-actix` since similarly same macro syntax is
supported in no matter the framework.

Purpose of this `warp` demo is to mainly demonstrate how `utoipa` and `utoipa-swagger-ui` can be integrated
Expand Down
2 changes: 1 addition & 1 deletion examples/warp-multiple-api-docs/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# warp-mutliple-api-docs ~ utoipa with utoipa-swagger-ui example

This is demo `warp` application with multiple api docs to demonstrate splitting apis with `utoipa` and `utoipa-swagger-ui`.
This is demo `warp` application with multiple API docs to demonstrate splitting APIs with `utoipa` and `utoipa-swagger-ui`.

Just run command below to run the demo application and browse to `http://localhost:8080/swagger-ui/`.
```bash
Expand Down
4 changes: 2 additions & 2 deletions utoipa-gen/src/component.rs
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ impl<'t> TypeTree<'t> {
}
}

// TODO should we recognize unknown generic types with `GenericType::Unkonwn` instead of `None`?
// TODO should we recognize unknown generic types with `GenericType::Unknown` instead of `None`?
fn get_generic_type(segment: &PathSegment) -> Option<GenericType> {
match &*segment.ident.to_string() {
"HashMap" | "Map" | "BTreeMap" => Some(GenericType::Map),
Expand Down Expand Up @@ -260,7 +260,7 @@ impl<'t> TypeTree<'t> {
/// Update current [`TypeTree`] from given `ident`.
///
/// It will update everything else except `children` for the `TypeTree`. This means that the
/// `TypeTree` will not be changed and will be travelsed as before update.
/// `TypeTree` will not be changed and will be traveled as before update.
fn update(&mut self, ident: Ident) {
let new_path = Path::from(ident);

Expand Down
4 changes: 2 additions & 2 deletions utoipa-gen/src/component/features.rs
Original file line number Diff line number Diff line change
Expand Up @@ -212,8 +212,8 @@ impl Feature {
),
Feature::Maximum(maximum) => maximum.validate(IsNumber(schema_type)),
Feature::Minimum(minimum) => minimum.validate(IsNumber(schema_type)),
Feature::ExclusiveMaximum(exlusive_maximum) => {
exlusive_maximum.validate(IsNumber(schema_type))
Feature::ExclusiveMaximum(exclusive_maximum) => {
exclusive_maximum.validate(IsNumber(schema_type))
}
Feature::ExclusiveMinimum(exclusive_minimum) => {
exclusive_minimum.validate(IsNumber(schema_type))
Expand Down
2 changes: 1 addition & 1 deletion utoipa-gen/src/component/into_params.rs
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ struct Param<'a> {

impl Param<'_> {
/// Resolve [`Param`] features and split features into two [`Vec`]s. Features are split by
/// whether they should be renderd in [`Param`] itself or in [`Param`]s schema.
/// whether they should be rendered in [`Param`] itself or in [`Param`]s schema.
///
/// Method returns a tuple containing two [`Vec`]s of [`Feature`].
fn resolve_field_features(&self) -> (Vec<Feature>, Vec<Feature>) {
Expand Down
2 changes: 1 addition & 1 deletion utoipa-gen/src/component/schema.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1322,7 +1322,7 @@ impl<'a> SchemaProperty<'a> {
}
}

/// Check wheter property is required or not
/// Check whether property is required or not
fn is_option(&self) -> bool {
matches!(self.type_tree.generic_type, Some(GenericType::Option))
}
Expand Down
4 changes: 2 additions & 2 deletions utoipa-gen/src/component/schema/enum_variant.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ pub trait Variant {
/// Implement `ToTokens` conversion for the [`Variant`]
fn to_tokens(&self) -> TokenStream;

/// Get enum varinat type. By default enum variant is `string`
/// Get enum variant type. By default enum variant is `string`
fn get_type(&self) -> (TokenStream, TokenStream) {
(
SchemaType(&parse_quote!(str)).to_token_stream(),
Expand Down Expand Up @@ -313,7 +313,7 @@ where
self.items.to_tokens(tokens);

// currently uses serde `tag` attribute as a discriminator. This discriminator
// feature needs some refinment.
// feature needs some refinement.
let discriminator = self.tag.as_ref().map(|tag| {
quote! {
.discriminator(Some(utoipa::openapi::schema::Discriminator::new(#tag)))
Expand Down
2 changes: 1 addition & 1 deletion utoipa-gen/src/doc_comment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ impl CommentAttributes {
None
}
}
_ => abort_call_site!("Exected only Meta::NameValue type"),
_ => abort_call_site!("Expected only Meta::NameValue type"),
}
}

Expand Down
2 changes: 1 addition & 1 deletion utoipa-gen/src/ext.rs
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ pub mod fn_arg {
}

impl FnArgType<'_> {
/// Get best effor name `Ident` for the type. For `FnArgType::Tuple` types it will take the first one
/// Get best effort name `Ident` for the type. For `FnArgType::Tuple` types it will take the first one
/// from `Vec`.
#[cfg(feature = "rocket_extras")]
pub(super) fn get_name(&self) -> &Ident {
Expand Down
2 changes: 1 addition & 1 deletion utoipa-gen/src/ext/rocket.rs
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ impl Parse for Path {
// expect format (GET, uri = "url...")
let ident = input.parse::<Ident>()?;
input.parse::<Token![,]>()?;
input.parse::<Ident>()?; // explisitly 'uri'
input.parse::<Ident>()?; // explicitly 'uri'
input.parse::<Token![=]>()?;

(
Expand Down
Loading

0 comments on commit 2e13074

Please sign in to comment.