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
4 changes: 4 additions & 0 deletions src/validators/any.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,8 @@ impl Validator for AnyValidator {
fn get_name(&self) -> &str {
Self::EXPECTED_TYPE
}

fn complete(&mut self, _build_context: &BuildContext<CombinedValidator>) -> PyResult<()> {
Ok(())
}
}
4 changes: 4 additions & 0 deletions src/validators/bool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,8 @@ impl Validator for BoolValidator {
fn get_name(&self) -> &str {
Self::EXPECTED_TYPE
}

fn complete(&mut self, _build_context: &BuildContext<CombinedValidator>) -> PyResult<()> {
Ok(())
}
}
8 changes: 8 additions & 0 deletions src/validators/bytes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ impl Validator for BytesValidator {
fn get_name(&self) -> &str {
Self::EXPECTED_TYPE
}

fn complete(&mut self, _build_context: &BuildContext<CombinedValidator>) -> PyResult<()> {
Ok(())
}
}

#[derive(Debug, Clone)]
Expand Down Expand Up @@ -90,6 +94,10 @@ impl Validator for BytesConstrainedValidator {
fn get_name(&self) -> &str {
"constrained-bytes"
}

fn complete(&mut self, _build_context: &BuildContext<CombinedValidator>) -> PyResult<()> {
Ok(())
}
}

impl BytesConstrainedValidator {
Expand Down
4 changes: 4 additions & 0 deletions src/validators/callable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,8 @@ impl Validator for CallableValidator {
fn get_name(&self) -> &str {
Self::EXPECTED_TYPE
}

fn complete(&mut self, _build_context: &BuildContext<CombinedValidator>) -> PyResult<()> {
Ok(())
}
}
4 changes: 4 additions & 0 deletions src/validators/dataclass.rs
Original file line number Diff line number Diff line change
Expand Up @@ -513,6 +513,10 @@ impl Validator for DataclassValidator {
fn get_name(&self) -> &str {
&self.name
}

fn complete(&mut self, build_context: &BuildContext<CombinedValidator>) -> PyResult<()> {
self.validator.complete(build_context)
}
}

impl DataclassValidator {
Expand Down
4 changes: 4 additions & 0 deletions src/validators/date.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,10 @@ impl Validator for DateValidator {
fn get_name(&self) -> &str {
Self::EXPECTED_TYPE
}

fn complete(&mut self, _build_context: &BuildContext<CombinedValidator>) -> PyResult<()> {
Ok(())
}
}

/// In lax mode, if the input is not a date, we try parsing the input as a datetime, then check it is an
Expand Down
4 changes: 4 additions & 0 deletions src/validators/datetime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,10 @@ impl Validator for DateTimeValidator {
fn get_name(&self) -> &str {
Self::EXPECTED_TYPE
}

fn complete(&mut self, _build_context: &BuildContext<CombinedValidator>) -> PyResult<()> {
Ok(())
}
}

#[derive(Debug, Clone)]
Expand Down
8 changes: 8 additions & 0 deletions src/validators/float.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,10 @@ impl Validator for FloatValidator {
fn get_name(&self) -> &str {
Self::EXPECTED_TYPE
}

fn complete(&mut self, _build_context: &BuildContext<CombinedValidator>) -> PyResult<()> {
Ok(())
}
}

#[derive(Debug, Clone)]
Expand Down Expand Up @@ -141,6 +145,10 @@ impl Validator for ConstrainedFloatValidator {
fn get_name(&self) -> &str {
"constrained-float"
}

fn complete(&mut self, _build_context: &BuildContext<CombinedValidator>) -> PyResult<()> {
Ok(())
}
}

impl BuildValidator for ConstrainedFloatValidator {
Expand Down
4 changes: 4 additions & 0 deletions src/validators/function.rs
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,10 @@ impl Validator for FunctionPlainValidator {
fn get_name(&self) -> &str {
&self.name
}

fn complete(&mut self, _build_context: &BuildContext<CombinedValidator>) -> PyResult<()> {
Ok(())
}
}

#[derive(Debug, Clone)]
Expand Down
8 changes: 8 additions & 0 deletions src/validators/int.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ impl Validator for IntValidator {
fn get_name(&self) -> &str {
Self::EXPECTED_TYPE
}

fn complete(&mut self, _build_context: &BuildContext<CombinedValidator>) -> PyResult<()> {
Ok(())
}
}

#[derive(Debug, Clone)]
Expand Down Expand Up @@ -112,6 +116,10 @@ impl Validator for ConstrainedIntValidator {
fn get_name(&self) -> &str {
"constrained-int"
}

fn complete(&mut self, _build_context: &BuildContext<CombinedValidator>) -> PyResult<()> {
Ok(())
}
}

impl ConstrainedIntValidator {
Expand Down
4 changes: 4 additions & 0 deletions src/validators/is_instance.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,4 +93,8 @@ impl Validator for IsInstanceValidator {
fn get_name(&self) -> &str {
&self.name
}

fn complete(&mut self, _build_context: &BuildContext<CombinedValidator>) -> PyResult<()> {
Ok(())
}
}
4 changes: 4 additions & 0 deletions src/validators/is_subclass.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,8 @@ impl Validator for IsSubclassValidator {
fn get_name(&self) -> &str {
&self.name
}

fn complete(&mut self, _build_context: &BuildContext<CombinedValidator>) -> PyResult<()> {
Ok(())
}
}
20 changes: 20 additions & 0 deletions src/validators/literal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,10 @@ impl Validator for LiteralSingleStringValidator {
fn get_name(&self) -> &str {
&self.name
}

fn complete(&mut self, _build_context: &BuildContext<CombinedValidator>) -> PyResult<()> {
Ok(())
}
}

#[derive(Debug, Clone)]
Expand Down Expand Up @@ -133,6 +137,10 @@ impl Validator for LiteralSingleIntValidator {
fn get_name(&self) -> &str {
&self.name
}

fn complete(&mut self, _build_context: &BuildContext<CombinedValidator>) -> PyResult<()> {
Ok(())
}
}

#[derive(Debug, Clone)]
Expand Down Expand Up @@ -188,6 +196,10 @@ impl Validator for LiteralMultipleStringsValidator {
fn get_name(&self) -> &str {
&self.name
}

fn complete(&mut self, _build_context: &BuildContext<CombinedValidator>) -> PyResult<()> {
Ok(())
}
}

#[derive(Debug, Clone)]
Expand Down Expand Up @@ -243,6 +255,10 @@ impl Validator for LiteralMultipleIntsValidator {
fn get_name(&self) -> &str {
&self.name
}

fn complete(&mut self, _build_context: &BuildContext<CombinedValidator>) -> PyResult<()> {
Ok(())
}
}

#[derive(Debug, Clone)]
Expand Down Expand Up @@ -325,6 +341,10 @@ impl Validator for LiteralGeneralValidator {
fn get_name(&self) -> &str {
&self.name
}

fn complete(&mut self, _build_context: &BuildContext<CombinedValidator>) -> PyResult<()> {
Ok(())
}
}

pub fn expected_repr_name(mut repr_args: Vec<String>, base_name: &'static str) -> (String, String) {
Expand Down
4 changes: 1 addition & 3 deletions src/validators/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -642,7 +642,5 @@ pub trait Validator: Send + Sync + Clone + Debug {

/// this method must be implemented for any validator which holds references to other validators,
/// it is used by `DefinitionRefValidator` to set its name
fn complete(&mut self, _build_context: &BuildContext<CombinedValidator>) -> PyResult<()> {
Ok(())
}
fn complete(&mut self, _build_context: &BuildContext<CombinedValidator>) -> PyResult<()>;
}
4 changes: 4 additions & 0 deletions src/validators/none.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,8 @@ impl Validator for NoneValidator {
fn get_name(&self) -> &str {
Self::EXPECTED_TYPE
}

fn complete(&mut self, _build_context: &BuildContext<CombinedValidator>) -> PyResult<()> {
Ok(())
}
}
8 changes: 8 additions & 0 deletions src/validators/string.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ impl Validator for StrValidator {
fn get_name(&self) -> &str {
Self::EXPECTED_TYPE
}

fn complete(&mut self, _build_context: &BuildContext<CombinedValidator>) -> PyResult<()> {
Ok(())
}
}

/// Any new properties set here must be reflected in `has_constraints_set`
Expand Down Expand Up @@ -118,6 +122,10 @@ impl Validator for StrConstrainedValidator {
fn get_name(&self) -> &str {
"constrained-str"
}

fn complete(&mut self, _build_context: &BuildContext<CombinedValidator>) -> PyResult<()> {
Ok(())
}
}

impl StrConstrainedValidator {
Expand Down
4 changes: 4 additions & 0 deletions src/validators/time.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,10 @@ impl Validator for TimeValidator {
fn get_name(&self) -> &str {
Self::EXPECTED_TYPE
}

fn complete(&mut self, _build_context: &BuildContext<CombinedValidator>) -> PyResult<()> {
Ok(())
}
}

fn convert_pytime(schema: &PyDict, field: &PyString) -> PyResult<Option<Time>> {
Expand Down
4 changes: 4 additions & 0 deletions src/validators/timedelta.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,10 @@ impl Validator for TimeDeltaValidator {
fn get_name(&self) -> &str {
Self::EXPECTED_TYPE
}

fn complete(&mut self, _build_context: &BuildContext<CombinedValidator>) -> PyResult<()> {
Ok(())
}
}

fn py_timedelta_as_timedelta(schema: &PyDict, field: &PyString) -> PyResult<Option<Duration>> {
Expand Down
8 changes: 8 additions & 0 deletions src/validators/url.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,10 @@ impl Validator for UrlValidator {
fn get_name(&self) -> &str {
&self.name
}

fn complete(&mut self, _build_context: &BuildContext<CombinedValidator>) -> PyResult<()> {
Ok(())
}
}

impl UrlValidator {
Expand Down Expand Up @@ -205,6 +209,10 @@ impl Validator for MultiHostUrlValidator {
fn get_name(&self) -> &str {
&self.name
}

fn complete(&mut self, _build_context: &BuildContext<CombinedValidator>) -> PyResult<()> {
Ok(())
}
}

impl MultiHostUrlValidator {
Expand Down