#[non_exhaustive]pub enum SpecError {
Show 31 variants
DuplicateOperationId {
operation_id: String,
first: String,
},
DuplicatePathTemplate {
template: String,
existing: String,
},
InvalidPathTemplate {
template: String,
reason: InvalidPathTemplate,
},
UndeclaredPathVariable {
name: String,
},
UnusedPathParameter {
name: String,
},
PathParameterNotRequired {
name: String,
},
DuplicateParameter {
name: String,
location: String,
},
ShortCircuitMismatch {
name: String,
declared: Vec<u16>,
described: Vec<u16>,
},
IllegalStyle {
style: String,
location: String,
},
IgnoredHeaderParameter {
name: String,
},
IgnoredHeader {
name: String,
},
NoResponses,
ConflictingEncoding,
MissingResponseDescription,
InvalidComponentName {
name: String,
},
DuplicateTag {
name: String,
},
UnknownTagParent {
name: String,
parent: String,
},
TagParentCycle {
name: String,
},
UnknownSecurityScheme {
name: String,
},
UndocumentedTag {
name: String,
},
EmptyServerVariableEnum {
name: String,
},
ServerVariableDefaultNotInEnum {
name: String,
},
InvalidExtensionName {
name: String,
},
UncheckedSchema,
NotAuthoritative,
OpaqueOperation {
reasons: Vec<OpaqueReason>,
},
OpaqueRoute {
pattern: String,
},
AuthorityNotStamped,
MalformedAnnotation {
name: String,
detail: String,
},
EmptyDocument,
RequiresV3_2 {
blockers: Vec<String>,
},
}Expand description
A way in which a document fails to conform.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
DuplicateOperationId
The same operationId was used more than once.
DuplicatePathTemplate
Two path templates differ only in the names of their variables.
InvalidPathTemplate
A paths key is not a legal path template.
Reachable only for a description read from somewhere else: a template Kynos constructs is checked when it is parsed.
reason holds the parse failure itself rather than its text, so a caller
can match on which rule the key broke. It is interpolated rather than
declared as a #[source]: a violation is rendered in a list, so its
message has to be self-contained, and a cause could then only repeat it.
UndeclaredPathVariable
A path template variable has no corresponding parameter.
UnusedPathParameter
A path parameter does not appear in the path template.
PathParameterNotRequired
A path parameter was not marked required.
DuplicateParameter
Two parameters share a name and location.
ShortCircuitMismatch
An interceptor’s short circuit declared statuses its responses do not describe, or the reverse.
Only reachable from a hand-written ShortCircuit; the one the
ApiError derive emits comes from the same declaration as the
responses and cannot disagree with them.
Fields
IllegalStyle
A serialization style is not legal at a parameter’s location.
IgnoredHeaderParameter
A header was declared as a parameter despite being ignored.
IgnoredHeader
A header was declared in a headers map despite being ignored.
The parameter-side counterpart is SpecError::IgnoredHeaderParameter.
NoResponses
An operation declared no responses.
ConflictingEncoding
encoding was declared beside prefixEncoding or itemEncoding.
3.2 makes the three mutually exclusive: the first names properties, the other two name array positions, and an object cannot be both.
Gated, because the two fields it conflicts with are 3.2’s — under 3.1
there is nothing for encoding to conflict with, so a variant that
existed there would be one no document could ever provoke.
MissingResponseDescription
A response carried no description, which 3.1 requires.
3.2 makes it optional, so this is raised only when validating against
3.1. The model holds Option<String> because a 3.2 document may state
only a summary; the version is what decides whether that is legal.
InvalidComponentName
A component key used characters the specification forbids.
DuplicateTag
Two tags share a name.
UnknownTagParent
A tag named a parent that does not exist.
TagParentCycle
A chain of tag parents forms a cycle.
UnknownSecurityScheme
A security requirement named a scheme that is not declared.
UndocumentedTag
An operation used a tag with no metadata.
EmptyServerVariableEnum
A server variable’s enum was empty.
ServerVariableDefaultNotInEnum
A server variable’s default was not among its permitted values.
InvalidExtensionName
An extension field name was malformed or reserved.
UncheckedSchema
A schema was deliberately left unconstrained.
Located at the schema itself: one carrying the x-kynos-unchecked
annotation wherever it is nested, or the permissive schema true where
it is a media type’s own schema or itemSchema. A $ref is not
followed, so a component is reported once, where it is defined.
NotAuthoritative
The description does not fully describe the service.
OpaqueOperation
An operation is emitted but is covered by an unchecked waiver.
It is still described; what it does is no longer verified.
Fields
reasons: Vec<OpaqueReason>Why the waiver was needed.
OpaqueRoute
A route is served but has no path template that could express it.
AuthorityNotStamped
The description is opaque somewhere but does not say so at the root.
The document-level stamp is the one-glance signal a consumer reads before deciding whether to trust anything else, so a description that omits it while carrying an opaque operation or route is worse than one that is honestly incomplete.
MalformedAnnotation
A Kynos annotation was present but not in the shape Kynos emits.
detail is text where
InvalidPathTemplate’s reason is a value,
and the asymmetry is forced rather than chosen: this cause is a
serde_json::Error, which is neither Clone nor PartialEq, so keeping
it would cost the derives every other value in the validation model has.
EmptyDocument
The document declared nothing at all.
RequiresV3_2
The document uses constructs that only OpenAPI 3.2 can express.
Trait Implementations§
impl Eq for SpecError
Source§impl Error for SpecError
impl Error for SpecError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
impl StructuralPartialEq for SpecError
Auto Trait Implementations§
impl Freeze for SpecError
impl RefUnwindSafe for SpecError
impl Send for SpecError
impl Sync for SpecError
impl Unpin for SpecError
impl UnsafeUnpin for SpecError
impl UnwindSafe for SpecError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.