Skip to content

Commit

Permalink
build(deps): bump derive_more from 0.99.18 to 1.0.0 (#81)
Browse files Browse the repository at this point in the history
* build(deps): bump derive_more from 0.99.18 to 1.0.0

Bumps [derive_more](https://github.com/JelteF/derive_more) from 0.99.18 to 1.0.0.
- [Release notes](https://github.com/JelteF/derive_more/releases)
- [Changelog](https://github.com/JelteF/derive_more/blob/master/CHANGELOG.md)
- [Commits](JelteF/derive_more@v0.99.18...v1.0.0)

---
updated-dependencies:
- dependency-name: derive_more
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>

* chore: upgrade invocations of derive_more

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Rob Ede <[email protected]>
  • Loading branch information
dependabot[bot] and robjtede authored Aug 18, 2024
1 parent b288449 commit 9adf70c
Show file tree
Hide file tree
Showing 9 changed files with 57 additions and 58 deletions.
37 changes: 18 additions & 19 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ conformance = ["validation", "reqwest", "prettytable-rs", "colored"]

[dependencies]
bytes = "1.7"
derive_more = "0.99"
derive_more = { version = "1", features = ["display", "error", "from"] }
futures-util = "0.3"
http = "1"
log = "0.4"
Expand Down
6 changes: 3 additions & 3 deletions src/conformance/operation.rs
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
use derive_more::Display;
use derive_more::derive::Display;
use http::Method;
use log::debug;

use crate::{spec::Operation, validation::Error as ValidationError, Spec};

#[derive(Debug, Clone, Display)]
pub enum OperationSpec {
#[display(fmt = "{} {}", method, path)]
#[display("{} {}", method, path)]
Parts { method: Method, path: String },

#[display(fmt = "OpID: {}", _0)]
#[display("OpID: {}", _0)]
OperationId(String),
}

Expand Down
14 changes: 7 additions & 7 deletions src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
use std::io;

use derive_more::{Display, Error, From};
use derive_more::derive::{Display, Error, From};

use crate::spec::Error as SpecError;
#[cfg(feature = "validation")]
Expand All @@ -11,23 +11,23 @@ use crate::validation::Error as ValidationError;
/// Top-level errors.
#[derive(Debug, Display, Error, From)]
pub enum Error {
#[display(fmt = "I/O error")]
#[display("I/O error")]
Io(io::Error),

#[display(fmt = "YAML error")]
#[display("YAML error")]
Yaml(serde_yml::Error),

#[display(fmt = "JSON error")]
#[display("JSON error")]
Serialize(serde_json::Error),

#[display(fmt = "Spec error")]
#[display("Spec error")]
Spec(SpecError),

#[cfg(feature = "validation")]
#[display(fmt = "Validation error")]
#[display("Validation error")]
Validation(ValidationError),

#[cfg(feature = "conformance")]
#[display(fmt = "Reqwest error")]
#[display("Reqwest error")]
Reqwest(reqwest::Error),
}
10 changes: 5 additions & 5 deletions src/spec/error.rs
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
use derive_more::{Display, Error, From};
use derive_more::derive::{Display, Error, From};
use semver::{Error as SemVerError, Version};

use crate::spec::{r#ref::RefError, schema::Error as SchemaError};

/// Spec Errors
#[derive(Debug, Display, Error, From)]
pub enum Error {
#[display(fmt = "Reference error")]
#[display("Reference error")]
Ref(RefError),

#[display(fmt = "Schema error")]
#[display("Schema error")]
Schema(SchemaError),

#[display(fmt = "Semver error")]
#[display("Semver error")]
SemVerError(SemVerError),

#[display(fmt = "Unsupported spec file version ({})", _0)]
#[display("Unsupported spec file version ({})", _0)]
UnsupportedSpecFileVersion(#[error(not(source))] Version),
}
2 changes: 1 addition & 1 deletion src/spec/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
use std::{collections::BTreeMap, iter::Iterator};

use derive_more::Error;
use derive_more::derive::Error;
use http::Method;
use log::debug;
use serde::{Deserialize, Serialize};
Expand Down
8 changes: 4 additions & 4 deletions src/spec/ref.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use std::str::FromStr;

use derive_more::{Display, Error};
use derive_more::derive::{Display, Error};
use log::trace;
use once_cell::sync::Lazy;
use regex::Regex;
Expand Down Expand Up @@ -36,14 +36,14 @@ where

#[derive(Clone, Debug, PartialEq, Display, Error)]
pub enum RefError {
#[display(fmt = "Invalid type: {}", _0)]
#[display("Invalid type: {}", _0)]
InvalidType(#[error(not(source))] String),

#[display(fmt = "Mismatched type: cannot reference a {} as a {}", _0, _1)]
#[display("Mismatched type: cannot reference a {} as a {}", _0, _1)]
MismatchedType(RefType, RefType),

// TODO: use some kind of path structure
#[display(fmt = "Unresolvable path: {}", _0)]
#[display("Unresolvable path: {}", _0)]
Unresolvable(#[error(not(source))] String),
}

Expand Down
8 changes: 4 additions & 4 deletions src/spec/schema.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,21 @@
use std::collections::BTreeMap;

use derive_more::{Display, Error};
use derive_more::derive::{Display, Error};
use serde::{Deserialize, Serialize};

use crate::spec::{FromRef, ObjectOrReference, Ref, RefError, RefType, Spec};

/// Schema Errors
#[derive(Debug, Clone, PartialEq, Display, Error)]
pub enum Error {
#[display(fmt = "Missing type property")]
#[display("Missing type property")]
NoType,

#[display(fmt = "Unknown type: {}", _0)]
#[display("Unknown type: {}", _0)]
UnknownType(#[error(not(source))] String),

#[display(fmt = "Required fields specified on a non-object schema")]
#[display("Required fields specified on a non-object schema")]
RequiredSpecifiedOnNonObject,
}

Expand Down
28 changes: 14 additions & 14 deletions src/validation/error.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use std::fmt;

use derive_more::{Display, Error};
use derive_more::derive::{Display, Error};
use http::{Method, StatusCode};
use serde_json::Value as JsonValue;

Expand Down Expand Up @@ -45,45 +45,45 @@ pub enum Error {
//
// Wrapped Errors
//
#[display(fmt = "Schema error")]
#[display("Schema error")]
Schema(SchemaError),

//
// Leaf Errors
//
#[display(fmt = "Not JSON")]
#[display("Not JSON")]
NotJson,

#[display(fmt = "{} is not one of {:?}", _0, _1)]
#[display("{} is not one of {:?}", _0, _1)]
TypeMismatch(Path, SchemaTypeSet),

#[display(fmt = "Array item type mismatch: {}", _0)]
#[display("Array item type mismatch: {}", _0)]
ArrayItemTypeMismatch(JsonValue, #[error(source)] Box<Error>),

#[display(fmt = "Undocumented field: {}", _0)]
#[display("Undocumented field: {}", _0)]
UndocumentedField(#[error(not(source))] String),

#[display(fmt = "Status mismatch: expected {}; got {}", _0, _1)]
#[display("Status mismatch: expected {}; got {}", _0, _1)]
StatusMismatch(StatusCode, StatusCode),

#[display(fmt = "Required field missing: {}", _0)]
#[display("Required field missing: {}", _0)]
RequiredFieldMissing(#[error(not(source))] Path),

#[display(fmt = "Type did not match any `anyOf` variant: {}\n{}", _0, _1)]
#[display("Type did not match any `anyOf` variant: {}\n{}", _0, _1)]
OneOfNoMatch(Path, AggregateError),

#[display(fmt = "Non-nullable field was null: {}", _0)]
#[display("Non-nullable field was null: {}", _0)]
InvalidNull(#[error(not(source))] Path),

#[display(fmt = "Operation not found: {} {}", _0, _1)]
#[display("Operation not found: {} {}", _0, _1)]
OperationNotFound(Method, String),

#[display(fmt = "Operation ID not found: {}", _0)]
#[display("Operation ID not found: {}", _0)]
OperationIdNotFound(#[error(not(source))] String),

#[display(fmt = "Parameter not found: {}", _0)]
#[display("Parameter not found: {}", _0)]
ParameterNotFound(#[error(not(source))] String),

#[display(fmt = "Invalid parameter location: {}", _0)]
#[display("Invalid parameter location: {}", _0)]
InvalidParameterLocation(#[error(not(source))] String),
}

0 comments on commit 9adf70c

Please sign in to comment.