Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ jobs:
# https://docs.github.com/en/actions/learn-github-actions/contexts#context-availability
strategy:
matrix:
msrv: ["1.72.1"] # Actix-web requires at least 1.72
msrv: ["1.85.0"] # Actix-web requires at least 1.83, Rust 2024 requires 1.85
name: ubuntu / ${{ matrix.msrv }}
steps:
- uses: actions/checkout@v4
Expand Down
6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
name = "actix-web-validation"
description = "A common validation interface for actix-web applications"
version = "0.8.0"
edition = "2021"
edition = "2024"
authors = ["Ross Sullivan <rosssullivan101@gmail.com>"]
repository = "https://github.com/ranger-ross/actix-web-validation"
license = "MIT"
# Try to match https://github.com/actix/actix-web/blob/master/Cargo.toml#L22
# Also be sure to update the README MSRV badge
rust-version = "1.72"
rust-version = "1.85"

[dependencies]
actix-web = "4"
Expand All @@ -21,7 +21,7 @@ serde = { version = "1", features = ["derive"]}
serde_json = "1"
validator = { version = "0.20", features = ["derive"] }
garde = { version = "0.22", features = ["derive"] }
derive_more = { version = "1", features = ["display"] }
derive_more = { version = "2", features = ["display"] }

[features]

Expand Down
4 changes: 2 additions & 2 deletions examples/garde_custom_error_response.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#![cfg(not(test))]

use actix_web::{
post, web::Json, App, HttpRequest, HttpResponse, HttpServer, Responder, ResponseError,
App, HttpRequest, HttpResponse, HttpServer, Responder, ResponseError, post, web::Json,
};
use actix_web_validation::{garde::GardeErrorHandlerExt, Validated};
use actix_web_validation::{Validated, garde::GardeErrorHandlerExt};
use derive_more::Display;
use garde::Validate;
use serde::{Deserialize, Serialize};
Expand Down
2 changes: 1 addition & 1 deletion examples/garde_simple.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#![cfg(not(test))]

use actix_web::{post, web::Json, App, HttpResponse, HttpServer, Responder};
use actix_web::{App, HttpResponse, HttpServer, Responder, post, web::Json};
use actix_web_validation::garde::Validated;
use garde::Validate;
use serde::{Deserialize, Serialize};
Expand Down
4 changes: 2 additions & 2 deletions examples/validator_custom_error_response.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#![cfg(not(test))]

use actix_web::{
post, web::Json, App, HttpRequest, HttpResponse, HttpServer, Responder, ResponseError,
App, HttpRequest, HttpResponse, HttpServer, Responder, ResponseError, post, web::Json,
};
use actix_web_validation::{validator::ValidatorErrorHandlerExt, Validated};
use actix_web_validation::{Validated, validator::ValidatorErrorHandlerExt};
use derive_more::Display;
use serde::{Deserialize, Serialize};
use std::sync::Arc;
Expand Down
2 changes: 1 addition & 1 deletion examples/validator_simple.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#![cfg(not(test))]

use actix_web::{post, web::Json, App, HttpResponse, HttpServer, Responder};
use actix_web::{App, HttpResponse, HttpServer, Responder, post, web::Json};
use actix_web_validation::Validated;
use serde::{Deserialize, Serialize};
use validator::Validate;
Expand Down
6 changes: 3 additions & 3 deletions src/custom.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
//!

use crate::validated_definition;
use actix_web::FromRequest;
use actix_web::dev::{ServiceFactory, ServiceRequest};
use actix_web::http::StatusCode;
use actix_web::FromRequest;
use actix_web::{App, HttpRequest, HttpResponse, ResponseError};
use std::fmt::Display;
use std::future::Future;
Expand All @@ -32,7 +32,7 @@ impl Display for ValidationError {
}
}

/// A validated extactor.
/// A validated extractor.
///
/// This type will run any validations on the inner extractors.
///
Expand Down Expand Up @@ -203,7 +203,7 @@ impl ValidationErrorHandlerExt for &mut actix_web::web::ServiceConfig {
mod test {
use super::*;
use actix_web::web::Bytes;
use actix_web::{http::header::ContentType, post, test, web::Json, App, Responder};
use actix_web::{App, Responder, http::header::ContentType, post, test, web::Json};
use serde::{Deserialize, Serialize};

#[derive(Debug, Deserialize, Serialize)]
Expand Down
6 changes: 3 additions & 3 deletions src/garde.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,17 @@

use crate::validated_definition;
use ::garde::Validate;
use actix_web::FromRequest;
use actix_web::dev::{ServiceFactory, ServiceRequest};
use actix_web::http::StatusCode;
use actix_web::FromRequest;
use actix_web::{App, HttpRequest, HttpResponse, ResponseError};
use std::fmt::Display;
use std::future::Future;
use std::sync::Arc;
use std::{fmt::Debug, ops::Deref, pin::Pin, task::Poll};
use thiserror::Error;

/// A validated extactor.
/// A validated extractor.
///
/// This type will run any validations on the inner extractors.
///
Expand Down Expand Up @@ -190,7 +190,7 @@ impl GardeErrorHandlerExt for &mut actix_web::web::ServiceConfig {
mod test {
use super::*;
use actix_web::web::Bytes;
use actix_web::{http::header::ContentType, post, test, web::Json, App, Responder};
use actix_web::{App, Responder, http::header::ContentType, post, test, web::Json};
use garde::Validate;
use serde::{Deserialize, Serialize};

Expand Down
6 changes: 3 additions & 3 deletions src/validator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@

use crate::validated_definition;
use ::validator::Validate;
use actix_web::FromRequest;
use actix_web::dev::{ServiceFactory, ServiceRequest};
use actix_web::http::StatusCode;
use actix_web::FromRequest;
use actix_web::{App, HttpRequest, HttpResponse, ResponseError};
use std::fmt::Display;
use std::future::Future;
Expand All @@ -27,7 +27,7 @@ use std::{fmt::Debug, ops::Deref, pin::Pin, task::Poll};
use thiserror::Error;
use validator::{ValidationError, ValidationErrors, ValidationErrorsKind};

/// A validated extactor.
/// A validated extractor.
///
/// This type will run any validations on the inner extractors.
///
Expand Down Expand Up @@ -231,7 +231,7 @@ impl ValidatorErrorHandlerExt for &mut actix_web::web::ServiceConfig {
mod test {
use super::*;
use actix_web::web::Bytes;
use actix_web::{http::header::ContentType, post, test, web::Json, App, Responder};
use actix_web::{App, Responder, http::header::ContentType, post, test, web::Json};
use serde::{Deserialize, Serialize};
use validator::Validate;

Expand Down