1#[cfg(feature = "v2")]
2use crate::v2::models::{DataType, ParameterIn};
3use thiserror::Error;
4
5#[derive(Debug, Error)]
7pub enum ValidationError {
8 #[error("Invalid $ref URI {:?}. Only relative URIs are supported.", _0)]
13 InvalidRefUri(String),
14 #[error("Reference missing in spec: {}", _0)]
16 MissingReference(String),
17 #[error(
19 "Parameter {:?} in path {:?} is a body but the schema is missing",
20 _0,
21 _1
22 )]
23 MissingSchemaForBodyParameter(String, String),
24 #[error("Path {:?} has header parameter {:?} which is not allowed", _1, _0)]
27 InvalidHeader(String, String),
28 #[cfg(feature = "v2")]
29 #[error(
31 "Parameter {:?} in path {:?} has specified {:?} type, but it's invalid for {:?} parameters",
32 _0,
33 _1,
34 _2,
35 _3
36 )]
37 InvalidParameterType(String, String, Option<DataType>, ParameterIn),
38}