docs: update validify examples in README.md
This commit is contained in:
@@ -166,8 +166,7 @@ use std::net::SocketAddr;
|
|||||||
use tokio::net::TcpListener;
|
use tokio::net::TcpListener;
|
||||||
use validify::{Payload, Validate, Validify};
|
use validify::{Payload, Validate, Validify};
|
||||||
|
|
||||||
// Payload is required.(Added in validify 1.3.0)
|
#[derive(Debug, Validify, Deserialize)]
|
||||||
#[derive(Debug, Validify, Deserialize, Payload)]
|
|
||||||
pub struct Pager {
|
pub struct Pager {
|
||||||
#[validate(range(min = 1.0, max = 50.0))]
|
#[validate(range(min = 1.0, max = 50.0))]
|
||||||
pub page_size: usize,
|
pub page_size: usize,
|
||||||
@@ -180,7 +179,7 @@ pub async fn pager_from_query(Validated(Query(pager)): Validated<Query<Pager>>)
|
|||||||
assert!((1..).contains(&pager.page_no));
|
assert!((1..).contains(&pager.page_no));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Payload is required.(Added in validify 1.3.0)
|
// Payload is now required for Validified. (Added in validify 1.3.0)
|
||||||
#[derive(Debug, Validify, Deserialize, Payload)]
|
#[derive(Debug, Validify, Deserialize, Payload)]
|
||||||
pub struct Parameters {
|
pub struct Parameters {
|
||||||
#[modify(lowercase)]
|
#[modify(lowercase)]
|
||||||
|
|||||||
Reference in New Issue
Block a user