openapi_types/json_schema/mod.rs
1#[derive(Debug, Clone, PartialEq)]
2pub enum SpecViolation {
3 /// https://datatracker.ietf.org/doc/html/draft-wright-json-schema-validation-00#section-5.15
4 /// > This array MUST have at least one element
5 EmptyRequired,
6
7 /// https://datatracker.ietf.org/doc/html/draft-wright-json-schema-validation-00#section-5.22
8 /// > This array MUST have at least one element
9 EmptyAllOf,
10
11 /// https://datatracker.ietf.org/doc/html/draft-wright-json-schema-validation-00#section-5.24
12 /// > This array MUST have at least one element
13 EmptyOneOf,
14}
15
16impl From<SpecViolation> for crate::SpecViolation {
17 fn from(reason: SpecViolation) -> Self {
18 crate::SpecViolation::JsonSchema(reason)
19 }
20}
21
22impl From<SpecViolation> for crate::Error {
23 fn from(reason: SpecViolation) -> Self {
24 crate::Error::SpecViolation(reason.into())
25 }
26}